| 
									
										
										
										
											2024-03-03 18:06:28 -05:00
										 |  |  | { | 
					
						
							|  |  |  |   lib, | 
					
						
							|  |  |  |   config, | 
					
						
							|  |  |  |   pkgs, | 
					
						
							|  |  |  |   name, | 
					
						
							|  |  |  |   publicKeys ? [ ], | 
					
						
							|  |  |  |   defaultShell ? "zsh", | 
					
						
							|  |  |  | }: | 
					
						
							| 
									
										
										
										
											2023-12-25 03:39:20 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   inherit name; | 
					
						
							| 
									
										
										
										
											2023-12-24 18:48:52 +01:00
										 |  |  |   isNormalUser = true; | 
					
						
							| 
									
										
										
										
											2024-02-05 22:45:43 +01:00
										 |  |  |   shell = lib.mkIf config.programs.${defaultShell}.enable pkgs.${defaultShell}; | 
					
						
							|  |  |  |   hashedPasswordFile = config.sops.secrets."${name}/user-password".path or null; | 
					
						
							|  |  |  |   openssh.authorizedKeys.keys = publicKeys; | 
					
						
							| 
									
										
										
										
											2023-12-24 18:48:52 +01:00
										 |  |  |   extraGroups = [ | 
					
						
							| 
									
										
										
										
											2025-06-01 15:56:44 -04:00
										 |  |  |     "users" | 
					
						
							| 
									
										
										
										
											2023-12-24 18:48:52 +01:00
										 |  |  |     "wheel" | 
					
						
							|  |  |  |     "media" | 
					
						
							|  |  |  |     (lib.mkIf config.networking.networkmanager.enable "networkmanager") | 
					
						
							|  |  |  |     (lib.mkIf config.programs.adb.enable "adbusers") | 
					
						
							|  |  |  |     (lib.mkIf config.programs.wireshark.enable "wireshark") | 
					
						
							| 
									
										
										
										
											2023-12-25 03:39:20 +01:00
										 |  |  |     (lib.mkIf config.virtualisation.docker.enable "docker") | 
					
						
							| 
									
										
										
										
											2024-05-27 23:30:59 -04:00
										 |  |  |     (lib.mkIf (with config.services.locate; (enable && package == pkgs.plocate)) "plocate") | 
					
						
							| 
									
										
										
										
											2023-12-24 18:48:52 +01:00
										 |  |  |     "libvirtd" | 
					
						
							|  |  |  |     "dialout" | 
					
						
							|  |  |  |     "plugdev" | 
					
						
							|  |  |  |     "uaccess" | 
					
						
							| 
									
										
										
										
											2024-08-22 02:40:56 -04:00
										 |  |  |     "ydotool" | 
					
						
							| 
									
										
										
										
											2023-12-24 18:48:52 +01:00
										 |  |  |   ]; | 
					
						
							| 
									
										
										
										
											2023-12-27 10:03:13 +01:00
										 |  |  | } |