feat(flake): add home-manager nixos module support to host.admin
This commit is contained in:
		
							parent
							
								
									25e02c034c
								
							
						
					
					
						commit
						ba2cbc18de
					
				
					 2 changed files with 22 additions and 3 deletions
				
			
		|  | @ -1,9 +1,10 @@ | |||
| { lib, config, pkgs, ... }: | ||||
| { lib, config, pkgs, inputs, outputs, self, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.systemModules.host.admin; | ||||
|   host = config.systemModules.host; | ||||
|   ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; | ||||
|   inherit (lib) types mkOption; | ||||
|   inherit (lib) mkIf types mkOption; | ||||
| in | ||||
| 
 | ||||
| { | ||||
|  | @ -23,6 +24,11 @@ in | |||
|       default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk"; | ||||
|       description = "The ssh key for the admin user"; | ||||
|     }; | ||||
|     homeManager = mkOption { | ||||
|       type = types.bool; | ||||
|       default = false; | ||||
|       description = "Enables home manager module for the admin user"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = { | ||||
|  | @ -45,5 +51,13 @@ in | |||
|         "torrenter" | ||||
|       ]; | ||||
|     }; | ||||
|     home-manager = mkIf cfg.homeManager { | ||||
|       useGlobalPkgs = true; | ||||
|       useUserPackages = true; | ||||
|       backupFileExtension = "hm.old"; | ||||
|       verbose = true; | ||||
|       extraSpecialArgs = { inherit inputs outputs self; }; | ||||
|       users.${cfg.name} = import "${self}/home/user/${cfg.name}/${host.name}"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue