mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
sane service: support remote scanners
This commit is contained in:
parent
65f9341370
commit
382047a135
2 changed files with 20 additions and 2 deletions
|
@ -17,12 +17,21 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
netConf = pkgs.writeTextFile {
|
||||
name = "net.conf";
|
||||
destination = "/etc/sane.d/net.conf";
|
||||
text = ''
|
||||
${lib.optionalString config.services.saned.enable "localhost"}
|
||||
${config.hardware.sane.netConf}
|
||||
'';
|
||||
};
|
||||
|
||||
env = {
|
||||
SANE_CONFIG_DIR = config.hardware.sane.configDir;
|
||||
LD_LIBRARY_PATH = [ "${saneConfig}/lib/sane" ];
|
||||
};
|
||||
|
||||
backends = [ pkg ] ++ optional config.services.saned.enable sanedConf ++ config.hardware.sane.extraBackends;
|
||||
backends = [ pkg netConf ] ++ optional config.services.saned.enable sanedConf ++ config.hardware.sane.extraBackends;
|
||||
saneConfig = pkgs.mkSaneConfig { paths = backends; };
|
||||
|
||||
enabled = config.hardware.sane.enable || config.services.saned.enable;
|
||||
|
@ -72,6 +81,15 @@ in
|
|||
description = "The value of SANE_CONFIG_DIR.";
|
||||
};
|
||||
|
||||
hardware.sane.netConf = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = "192.168.0.16";
|
||||
description = ''
|
||||
Network hosts that should be probed for remote scanners.
|
||||
'';
|
||||
};
|
||||
|
||||
services.saned.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue