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