1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6 meta.maintainers = [ maintainers.league ];
7
8 ###### interface
9 options = {
10 programs.gphoto2 = {
11 enable = mkOption {
12 default = false;
13 type = types.bool;
14 description = ''
15 Whether to configure system to use gphoto2.
16 To grant digital camera access to a user, the user must
17 be part of the camera group:
18 <code>users.users.alice.extraGroups = ["camera"];</code>
19 '';
20 };
21 };
22 };
23
24 ###### implementation
25 config = mkIf config.programs.gphoto2.enable {
26 services.udev.packages = [ pkgs.libgphoto2 ];
27 environment.systemPackages = [ pkgs.gphoto2 ];
28 users.groups.camera = {};
29 };
30}