2016-12-27 18:39:53 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
meta.maintainers = [ maintainers.league ];
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
programs.gphoto2 = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
|
|
|
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
|
|
|
<code>users.users.alice.extraGroups = ["camera"];</code>
|
2016-12-27 18:39:53 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.programs.gphoto2.enable {
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|