forked from jan-leila/nix-config
		
	added users that can be disabled
This commit is contained in:
		
							parent
							
								
									9418b91b4d
								
							
						
					
					
						commit
						eda1db9136
					
				
					 6 changed files with 193 additions and 94 deletions
				
			
		|  | @ -1,6 +1,5 @@ | ||||||
| # leyla laptop | # leyla laptop | ||||||
| { config, pkgs, inputs, ... }: | { config, pkgs, inputs, ... }: | ||||||
| 
 |  | ||||||
| { | { | ||||||
|   imports = |   imports = | ||||||
|     [ |     [ | ||||||
|  | @ -17,6 +16,10 @@ | ||||||
| 
 | 
 | ||||||
|   sops.age.keyFile = "/home/leyla/.config/sops/age/keys.txt"; |   sops.age.keyFile = "/home/leyla/.config/sops/age/keys.txt"; | ||||||
| 
 | 
 | ||||||
|  |   users.leyla.isNormalUser = true; | ||||||
|  |   users.ester.isNormalUser = true; | ||||||
|  |   users.eve.isNormalUser = true; | ||||||
|  | 
 | ||||||
|   # Bootloader. |   # Bootloader. | ||||||
|   boot.loader.systemd-boot.enable = true; |   boot.loader.systemd-boot.enable = true; | ||||||
|   boot.loader.efi.canTouchEfiVariables = true; |   boot.loader.efi.canTouchEfiVariables = true; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| {...}: | { ... }: | ||||||
| { | { | ||||||
|   imports = [ ./leyla ./ester ./eve ]; |   imports = [ ./leyla ./ester ./eve ./remote ]; | ||||||
| 
 | 
 | ||||||
|   users.mutableUsers = false; |   users.mutableUsers = false; | ||||||
| } | } | ||||||
|  | @ -1,23 +1,45 @@ | ||||||
| { lib, config, pkgs, ... }: | { lib, config, pkgs, ... }: | ||||||
|  | let | ||||||
|  |   cfg = config.users.ester; | ||||||
|  | in | ||||||
| { | { | ||||||
|   sops.secrets."passwords/ester" = { |   options.users.ester = { | ||||||
|     neededForUsers = true; |     isNormalUser = lib.mkEnableOption "ester"; | ||||||
|     # sopsFile = ../secrets.yaml; |  | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # Define user accounts |   config = { | ||||||
|   users.users.ester = { |     sops.secrets = lib.mkIf cfg.isNormalUser { | ||||||
|     isNormalUser = true; |       "passwords/ester" = { | ||||||
|     uid = 1001; |         neededForUsers = true; | ||||||
|     description = "Ester"; |         # sopsFile = ../secrets.yaml; | ||||||
|     extraGroups = [ "networkmanager" ]; |       }; | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|     hashedPasswordFile = config.sops.secrets."passwords/ester".path; |     users.groups.ester = {}; | ||||||
| 
 | 
 | ||||||
|     packages = with pkgs; [ |     users.users.ester = lib.mkMerge [ | ||||||
|       firefox |       { | ||||||
|       bitwarden |         uid = 1001; | ||||||
|       discord |         description = "Ester"; | ||||||
|  |         group = "ester"; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       ( | ||||||
|  |         if cfg.isNormalUser then { | ||||||
|  |           isNormalUser = true; | ||||||
|  |           extraGroups = [ "networkmanager" ]; | ||||||
|  | 
 | ||||||
|  |           hashedPasswordFile = config.sops.secrets."passwords/ester".path; | ||||||
|  | 
 | ||||||
|  |           packages = with pkgs; [ | ||||||
|  |             firefox | ||||||
|  |             bitwarden | ||||||
|  |             discord | ||||||
|  |           ]; | ||||||
|  |         } else { | ||||||
|  |           isSystemUser = true; | ||||||
|  |         } | ||||||
|  |       ) | ||||||
|     ]; |     ]; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  | @ -1,25 +1,47 @@ | ||||||
| { lib, config, pkgs, ... }: | { lib, config, pkgs, ... }: | ||||||
|  | let | ||||||
|  |   cfg = config.users.eve; | ||||||
|  | in | ||||||
| { | { | ||||||
|   sops.secrets."passwords/eve" = { |   options.users.eve = { | ||||||
|     neededForUsers = true; |     isNormalUser = lib.mkEnableOption "eve"; | ||||||
|     # sopsFile = ../secrets.yaml; |  | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # Define user accounts |   config = { | ||||||
|   users.users.eve = { |     sops.secrets = lib.mkIf cfg.isNormalUser { | ||||||
|     isNormalUser = true; |       "passwords/eve" = { | ||||||
|     uid = 1002; |         neededForUsers = true; | ||||||
|     description = "Eve"; |         # sopsFile = ../secrets.yaml; | ||||||
|     extraGroups = [ "networkmanager" ]; |       }; | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|     hashedPasswordFile = config.sops.secrets."passwords/eve".path; |     users.groups.eve = {}; | ||||||
| 
 | 
 | ||||||
|     packages = with pkgs; [ |     users.users.eve = lib.mkMerge [ | ||||||
|       firefox |       { | ||||||
|       bitwarden |         uid = 1002; | ||||||
|       discord |         description = "Eve"; | ||||||
|       makemkv |         group = "eve"; | ||||||
|       signal-desktop |       } | ||||||
|  | 
 | ||||||
|  |       ( | ||||||
|  |         if cfg.isNormalUser then { | ||||||
|  |           isNormalUser = true; | ||||||
|  |           extraGroups = [ "networkmanager" ]; | ||||||
|  | 
 | ||||||
|  |           hashedPasswordFile = config.sops.secrets."passwords/eve".path; | ||||||
|  | 
 | ||||||
|  |           packages = with pkgs; [ | ||||||
|  |             firefox | ||||||
|  |             bitwarden | ||||||
|  |             discord | ||||||
|  |             makemkv | ||||||
|  |             signal-desktop | ||||||
|  |           ]; | ||||||
|  |         } else { | ||||||
|  |           isSystemUser = true; | ||||||
|  |         } | ||||||
|  |       ) | ||||||
|     ]; |     ]; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  | @ -1,69 +1,91 @@ | ||||||
| { lib, config, pkgs, ... }: | { lib, config, pkgs, ... }: | ||||||
|  | let | ||||||
|  |   cfg = config.users.leyla; | ||||||
|  | in | ||||||
| { | { | ||||||
|   sops.secrets."passwords/leyla" = { |   options.users.leyla = { | ||||||
|     neededForUsers = true; |     isNormalUser = lib.mkEnableOption "leyla"; | ||||||
|     # sopsFile = ../secrets.yaml; |  | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # Define user accounts |   config = { | ||||||
|   users.users.leyla = { |     sops.secrets = lib.mkIf cfg.isNormalUser { | ||||||
|     isNormalUser = true; |       "passwords/leyla" = { | ||||||
|     uid = 1000; |         neededForUsers = true; | ||||||
|     description = "Leyla"; |         # sopsFile = ../secrets.yaml; | ||||||
|     extraGroups = [ "networkmanager" "wheel" ]; |       }; | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|     hashedPasswordFile = config.sops.secrets."passwords/leyla".path; |     users.groups.leyla = {}; | ||||||
| 
 | 
 | ||||||
|     packages = with pkgs; [ |     users.users.leyla = lib.mkMerge [ | ||||||
|       iputils |       { | ||||||
|       dnsutils |         uid = 1000; | ||||||
|       git |         description = "Leyla"; | ||||||
|       firefox |         group = "leyla"; | ||||||
|       signal-desktop |       } | ||||||
|       obsidian | 
 | ||||||
|       bitwarden |       ( | ||||||
|       vscodium |         if cfg.isNormalUser then { | ||||||
|       nextcloud-client |           isNormalUser = true; | ||||||
|       inkscape |           extraGroups = [ "networkmanager" "wheel" ]; | ||||||
|       steam | 
 | ||||||
|       discord |           hashedPasswordFile = config.sops.secrets."passwords/leyla".path; | ||||||
|       rhythmbox |            | ||||||
|       makemkv |           packages = with pkgs; [ | ||||||
|       protonvpn-gui |             iputils | ||||||
|       transmission-gtk |             dnsutils | ||||||
|       freecad |             git | ||||||
|       mupen64plus |             firefox | ||||||
|       dbeaver |             signal-desktop | ||||||
|       easytag |             obsidian | ||||||
|       cura |             bitwarden | ||||||
|       kicad-small |             vscodium | ||||||
| #        jdk |             nextcloud-client | ||||||
| #        android-tools |             inkscape | ||||||
| #        android-studio |             steam | ||||||
|       androidStudioPackages.canary |             discord | ||||||
|       jetbrains.idea-community |             rhythmbox | ||||||
|       ungoogled-chromium |             makemkv | ||||||
|       nodejs |             protonvpn-gui | ||||||
|       exiftool |             transmission-gtk | ||||||
|       libreoffice |             freecad | ||||||
|       # N64 Emulator |             mupen64plus | ||||||
|       mupen64plus |             dbeaver | ||||||
|       # GameCube Emulator and Wii Emulator |             easytag | ||||||
|       dolphin-emu |             cura | ||||||
|       # Switch Emulator |             kicad-small | ||||||
|       yuzu-mainline |       #        jdk | ||||||
|       # Atari 2600 Emulator |       #        android-tools | ||||||
|       stella |       #        android-studio | ||||||
|       # mame Emulator |             androidStudioPackages.canary | ||||||
|       mame |             jetbrains.idea-community | ||||||
|       # Game Boy Advanced Emulator |             ungoogled-chromium | ||||||
|       vbam |             nodejs | ||||||
|       # NES Emulator |             exiftool | ||||||
|       fceux |             libreoffice | ||||||
|       # SNES Emulator |             # N64 Emulator | ||||||
|       zsnes |             mupen64plus | ||||||
|       # DS Emulator |             # GameCube Emulator and Wii Emulator | ||||||
|       desmume |             dolphin-emu | ||||||
|  |             # Switch Emulator | ||||||
|  |             yuzu-mainline | ||||||
|  |             # Atari 2600 Emulator | ||||||
|  |             stella | ||||||
|  |             # mame Emulator | ||||||
|  |             mame | ||||||
|  |             # Game Boy Advanced Emulator | ||||||
|  |             vbam | ||||||
|  |             # NES Emulator | ||||||
|  |             fceux | ||||||
|  |             # SNES Emulator | ||||||
|  |             zsnes | ||||||
|  |             # DS Emulator | ||||||
|  |             desmume | ||||||
|  |           ]; | ||||||
|  |         } else { | ||||||
|  |           isSystemUser = true; | ||||||
|  |         } | ||||||
|  |       ) | ||||||
|     ]; |     ]; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
							
								
								
									
										30
									
								
								users/remote/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								users/remote/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | ||||||
|  | {  lib, config, ... }: | ||||||
|  | let | ||||||
|  |   cfg = config.users.remote; | ||||||
|  | in | ||||||
|  | { | ||||||
|  |   options.users.remote = { | ||||||
|  |     isNormalUser = lib.mkEnableOption "remote"; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   config.users = { | ||||||
|  |     groups.remote = {}; | ||||||
|  | 
 | ||||||
|  |     users.remote = lib.mkMerge [ | ||||||
|  |       { | ||||||
|  |         uid = 2000; | ||||||
|  |         group = "remote"; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       ( | ||||||
|  |         if cfg.isNormalUser then { | ||||||
|  |           # extraGroups = [ "wheel" ]; | ||||||
|  |           isNormalUser = true; | ||||||
|  |           openssh.authorizedKeys.keys = []; | ||||||
|  |         } else { | ||||||
|  |           isSystemUser = true; | ||||||
|  |         } | ||||||
|  |       ) | ||||||
|  |     ]; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue