2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
meta.maintainers = [ maintainers.league ];
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
programs.gphoto2 = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Whether to configure system to use gphoto2.
|
|
|
|
To grant digital camera access to a user, the user must
|
|
|
|
be part of the camera group:
|
2022-08-12 12:06:08 +00:00
|
|
|
`users.users.alice.extraGroups = ["camera"];`
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.programs.gphoto2.enable {
|
|
|
|
services.udev.packages = [ pkgs.libgphoto2 ];
|
|
|
|
environment.systemPackages = [ pkgs.gphoto2 ];
|
|
|
|
users.groups.camera = {};
|
|
|
|
};
|
|
|
|
}
|