| 
									
										
										
										
											2016-12-27 13:39:53 -05: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-30 01:58:35 +02:00
										 |  |  |           <code>users.users.alice.extraGroups = ["camera"];</code> | 
					
						
							| 
									
										
										
										
											2016-12-27 13:39:53 -05:00
										 |  |  |         '';
 | 
					
						
							|  |  |  |       }; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ###### implementation | 
					
						
							|  |  |  |   config = mkIf config.programs.gphoto2.enable { | 
					
						
							|  |  |  |     services.udev.packages = [ pkgs.libgphoto2 ]; | 
					
						
							|  |  |  |     environment.systemPackages = [ pkgs.gphoto2 ]; | 
					
						
							| 
									
										
										
										
											2018-06-30 01:58:35 +02:00
										 |  |  |     users.groups.camera = {}; | 
					
						
							| 
									
										
										
										
											2016-12-27 13:39:53 -05:00
										 |  |  |   }; | 
					
						
							|  |  |  | } |