diff options
author | Jörg Thalheim <joerg@higgsboson.tk> | 2017-01-01 11:16:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-01 11:16:28 +0100 |
commit | 84a50084c33635a91aebd3bece4d3b71293341de (patch) | |
tree | a442aaa1eaa6bd364fdfde15099081b39456b118 /nixos | |
parent | db8c9ef3ffabd401004484158463526240a7e318 (diff) | |
parent | 6eead52e1252413ea835fa1261bbf73ff569d23d (diff) | |
download | nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar.gz nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar.bz2 nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar.lz nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar.xz nixlib-84a50084c33635a91aebd3bece4d3b71293341de.tar.zst nixlib-84a50084c33635a91aebd3bece4d3b71293341de.zip |
Merge pull request #21444 from league/fix/gphoto2-udev
gphoto2: nixos programs module to configure udev
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/gphoto2.nix | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f07fe7c1395c..be09fb80e0ac 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -71,6 +71,7 @@ ./programs/environment.nix ./programs/fish.nix ./programs/freetds.nix + ./programs/gphoto2.nix ./programs/info.nix ./programs/java.nix ./programs/kbdlight.nix diff --git a/nixos/modules/programs/gphoto2.nix b/nixos/modules/programs/gphoto2.nix new file mode 100644 index 000000000000..47822562aee1 --- /dev/null +++ b/nixos/modules/programs/gphoto2.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta.maintainers = [ maintainers.league ]; + + ###### interface + options = { + programs.gphoto2 = { + enable = mkOption { + default = false; + example = true; + type = types.bool; + description = '' + Whether to configure system to use gphoto2. + To grant digital camera access to a user, the user must + be part of the camera group: + <code>users.extraUsers.alice.extraGroups = ["camera"];</code> + ''; + }; + }; + }; + + ###### implementation + config = mkIf config.programs.gphoto2.enable { + services.udev.packages = [ pkgs.libgphoto2 ]; + environment.systemPackages = [ pkgs.gphoto2 ]; + users.extraGroups.camera = {}; + }; +} |