scanbuddy/flake.nix

60 lines
1.2 KiB
Nix
Raw Normal View History

2025-09-25 17:42:36 +02:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
} @ inputs: let
system = "x86_64-linux";
2025-09-26 00:26:43 +02:00
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
2025-09-25 17:42:36 +02:00
in {
2025-09-26 00:26:43 +02:00
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
python313
python313Packages.flask
python313Packages.waitress
];
shellHook = ''
python --version
exec zsh
'';
};
packages.${system} = let
scanbuddy = pkgs.writeShellApplication {
name = "scanbuddy-script";
runtimeInputs = with pkgs; [sane-backends brscan5 ghostscript];
text = builtins.readFile ./scanbuddy.bash;
};
wrapper = pkgs.writeShellApplication {
name = "scanbuddy-wrapper";
2025-09-25 17:42:36 +02:00
2025-09-26 00:26:43 +02:00
text =
/*
bash
*/
''
#!/usr/bin/env bash
readarray -d '_' args < <(printf "%s" "$1")
2025-09-25 17:42:36 +02:00
2025-09-26 00:26:43 +02:00
scanbuddy "''${args[@]}"
'';
};
package = pkgs.symlinkJoin {
name = "scanbuddy";
paths = [scanbuddy wrapper];
};
in {
default = package;
inherit scanbuddy;
inherit wrapper;
2025-09-25 17:42:36 +02:00
};
};
}