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