2016-12-27 18:39:53 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2024-04-17 11:37:58 +00:00
|
|
|
meta.maintainers = [ lib.maintainers.league ];
|
2016-12-27 18:39:53 +00:00
|
|
|
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
programs.gphoto2 = {
|
2024-04-17 11:37:58 +00:00
|
|
|
enable = lib.mkOption {
|
2016-12-27 18:39:53 +00:00
|
|
|
default = false;
|
2024-04-17 11:37:58 +00:00
|
|
|
type = lib.types.bool;
|
2016-12-27 18:39:53 +00:00
|
|
|
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:
|
2018-06-29 23:58:35 +00:00
|
|
|
`users.users.alice.extraGroups = ["camera"];`
|
2016-12-27 18:39:53 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
2024-04-17 11:37:58 +00:00
|
|
|
config = lib.mkIf config.programs.gphoto2.enable {
|
2016-12-27 18:39:53 +00:00
|
|
|
services.udev.packages = [ pkgs.libgphoto2 ];
|
|
|
|
environment.systemPackages = [ pkgs.gphoto2 ];
|
2018-06-29 23:58:35 +00:00
|
|
|
users.groups.camera = {};
|
2016-12-27 18:39:53 +00:00
|
|
|
};
|
|
|
|
}
|