diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-30 17:37:45 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-30 18:47:43 +0100 |
commit | 408b8b5725c3e6fff75aef772da248d3e95ff414 (patch) | |
tree | 692e3b61dbbff85cc97e3becf13a1376dea04a92 /nixos/modules/services/hardware/sane.nix | |
parent | d882e1966251880240599d3c1b31e060661506ee (diff) | |
download | nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.gz nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.bz2 nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.lz nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.xz nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.zst nixlib-408b8b5725c3e6fff75aef772da248d3e95ff414.zip |
Add lots of missing option types
Diffstat (limited to 'nixos/modules/services/hardware/sane.nix')
-rw-r--r-- | nixos/modules/services/hardware/sane.nix | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/nixos/modules/services/hardware/sane.nix b/nixos/modules/services/hardware/sane.nix index 905445f22c1b..5979feb82409 100644 --- a/nixos/modules/services/hardware/sane.nix +++ b/nixos/modules/services/hardware/sane.nix @@ -2,6 +2,12 @@ with pkgs.lib; +let + + pkg = if config.hardware.sane.snapshot then pkgs.saneBackendsGit else pkgs.saneBackends; + +in + { ###### interface @@ -9,11 +15,13 @@ with pkgs.lib; options = { hardware.sane.enable = mkOption { + type = types.bool; default = false; description = "Enable support for SANE scanners."; }; hardware.sane.snapshot = mkOption { + type = types.bool; default = false; description = "Use a development snapshot of SANE scanner drivers."; }; @@ -23,18 +31,13 @@ with pkgs.lib; ###### implementation - config = let pkg = if config.hardware.sane.snapshot - then pkgs.saneBackendsGit - else pkgs.saneBackends; - in mkIf config.hardware.sane.enable { - environment.systemPackages = [ pkg ]; - services.udev.packages = [ pkg ]; - - users.extraGroups = singleton { - name = "scanner"; - gid = config.ids.gids.scanner; - }; - - }; + config = mkIf config.hardware.sane.enable { + + environment.systemPackages = [ pkg ]; + services.udev.packages = [ pkg ]; + + users.extraGroups."scanner".gid = config.ids.gids.scanner; + + }; } |