Refactored home configurations
Comon config is handled in `modules/home/home/default.nix`.
This commit is contained in:
		
							parent
							
								
									92aec37282
								
							
						
					
					
						commit
						14620e645f
					
				
					 5 changed files with 61 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -1,27 +0,0 @@
 | 
			
		|||
{...}: {
 | 
			
		||||
  aa = {
 | 
			
		||||
    apps = {
 | 
			
		||||
      bat.enable = true;
 | 
			
		||||
      btop.enable = true;
 | 
			
		||||
      tmux.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    programs = {
 | 
			
		||||
      firefox.enable = true;
 | 
			
		||||
      fzf.enable = true;
 | 
			
		||||
      gpg.enable = true;
 | 
			
		||||
      kitty.enable = true;
 | 
			
		||||
      zoxide.enable = true;
 | 
			
		||||
      yazi.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    tools = {
 | 
			
		||||
      direnv.enable = true;
 | 
			
		||||
      eza.enable = true;
 | 
			
		||||
      git.enable = true;
 | 
			
		||||
      zsh.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    windowManagers.sway.enable = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								homes/x86_64-linux/alejandro@carbon/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								homes/x86_64-linux/alejandro@carbon/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
{...}: {
 | 
			
		||||
  aa.isHeadless = false;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								homes/x86_64-linux/alejandro@gospel/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								homes/x86_64-linux/alejandro@gospel/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
{...}: {
 | 
			
		||||
  aa.isHeadless = false;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								homes/x86_64-linux/alejandro@node/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								homes/x86_64-linux/alejandro@node/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
{...}: {
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +1,59 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  osConfig ? {},
 | 
			
		||||
  namespace,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  home.stateVersion = lib.mkDefault (osConfig.system.stateVersion or "24.05");
 | 
			
		||||
  options.${namespace} = {
 | 
			
		||||
    isHeadless = lib.mkOption {
 | 
			
		||||
      type = lib.types.bool;
 | 
			
		||||
      default = true;
 | 
			
		||||
      description = "If true, graphical applications (e.g. firefox, sway, etc) won't be installed.";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    installDefaults = lib.mkOption {
 | 
			
		||||
      type = lib.types.bool;
 | 
			
		||||
      default = true;
 | 
			
		||||
      description = "If true, a default set of packages will be installed.";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = lib.mkMerge [
 | 
			
		||||
    (
 | 
			
		||||
      lib.mkIf (!config.${namespace}.isHeadless) {
 | 
			
		||||
        ${namespace} = {
 | 
			
		||||
          programs.firefox.enable = true;
 | 
			
		||||
          windowManagers.sway.enable = true;
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
    (lib.mkIf (config.${namespace}.installDefaults) {
 | 
			
		||||
      ${namespace} = {
 | 
			
		||||
        apps = {
 | 
			
		||||
          bat.enable = true;
 | 
			
		||||
          btop.enable = true;
 | 
			
		||||
          tmux.enable = true;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        programs = {
 | 
			
		||||
          fzf.enable = true;
 | 
			
		||||
          gpg.enable = true;
 | 
			
		||||
          kitty.enable = true;
 | 
			
		||||
          zoxide.enable = true;
 | 
			
		||||
          yazi.enable = true;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        tools = {
 | 
			
		||||
          direnv.enable = true;
 | 
			
		||||
          eza.enable = true;
 | 
			
		||||
          git.enable = true;
 | 
			
		||||
          zsh.enable = true;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    })
 | 
			
		||||
    {
 | 
			
		||||
      home.stateVersion = lib.mkDefault (osConfig.system.stateVersion or "24.05");
 | 
			
		||||
    }
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue