41 lines
		
	
	
	
		
			960 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
	
		
			960 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ lib, config, pkgs, inputs, outputs, self, ... }:
 | 
						|
 | 
						|
let
 | 
						|
  cfg = config.ooknet.host.admin;
 | 
						|
  ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
 | 
						|
  inherit (lib) mkIf;
 | 
						|
in
 | 
						|
 | 
						|
{
 | 
						|
  config = {
 | 
						|
    users.users.${cfg.name} = {
 | 
						|
      isNormalUser = true;
 | 
						|
      shell = pkgs.${cfg.shell};
 | 
						|
      initialPassword = "password";
 | 
						|
      openssh.authorizedKeys.keys = [ "${cfg.sshKey}" ];
 | 
						|
      extraGroups = [
 | 
						|
        "wheel"
 | 
						|
        "video"
 | 
						|
        "audio"
 | 
						|
        ] ++ ifTheyExist [
 | 
						|
        "git"
 | 
						|
        "media"
 | 
						|
        "network"
 | 
						|
        "libvirtd"
 | 
						|
        "deluge"
 | 
						|
        "streamer"
 | 
						|
        "torrenter"
 | 
						|
      ];
 | 
						|
    };
 | 
						|
    home-manager = mkIf cfg.homeManager {
 | 
						|
      useGlobalPkgs = true;
 | 
						|
      useUserPackages = true;
 | 
						|
      backupFileExtension = "hm.old";
 | 
						|
      verbose = true;
 | 
						|
      extraSpecialArgs = { inherit inputs outputs self; };
 | 
						|
      users.${cfg.name} = {
 | 
						|
        imports = [ "${self}/home" ];
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |