nixos/sane: allow to disable enabled-by-default plugins

use case: disabling v4l plugin because I don't use my webcam as a
scanner.
This commit is contained in:
Symphorien Gibol
2021-02-19 16:52:26 +01:00
parent 6b1057b452
commit c64fb5000b
2 changed files with 21 additions and 4 deletions
+11 -1
View File
@@ -32,7 +32,7 @@ let
};
backends = [ pkg netConf ] ++ optional config.services.saned.enable sanedConf ++ config.hardware.sane.extraBackends;
saneConfig = pkgs.mkSaneConfig { paths = backends; };
saneConfig = pkgs.mkSaneConfig { paths = backends; inherit (config.hardware.sane) disabledDefaultBackends; };
enabled = config.hardware.sane.enable || config.services.saned.enable;
@@ -75,6 +75,16 @@ in
example = literalExample "[ pkgs.hplipWithPlugin ]";
};
hardware.sane.disabledDefaultBackends = mkOption {
type = types.listOf types.str;
default = [];
example = [ "v4l" ];
description = ''
Names of backends which are enabled by default but should be disabled.
See <literal>$SANE_CONFIG_DIR/dll.conf</literal> for the list of possible names.
'';
};
hardware.sane.configDir = mkOption {
type = types.str;
internal = true;