add: more system modules
This commit is contained in:
		
							parent
							
								
									47eb3e0691
								
							
						
					
					
						commit
						793cc3131c
					
				
					 17 changed files with 291 additions and 56 deletions
				
			
		
							
								
								
									
										40
									
								
								system/modules/user/shell/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								system/modules/user/shell/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
{ lib, config, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.systemModules.user.shell;
 | 
			
		||||
in
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./fish
 | 
			
		||||
    # ./bash
 | 
			
		||||
    # ./zsh
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  options.systemModules.user.shell = {
 | 
			
		||||
    fish = {
 | 
			
		||||
      enable = lib.mkEnableOption "Enable fish as the user shell";
 | 
			
		||||
    };
 | 
			
		||||
    zsh = {
 | 
			
		||||
      enable = lib.mkEnableOption "Enable zsh as the user shell";
 | 
			
		||||
    };
 | 
			
		||||
    bash = {
 | 
			
		||||
      enable = lib.mkEnableOption "Enable bash as the user shell";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
   config = { 
 | 
			
		||||
    assertions = [
 | 
			
		||||
      {
 | 
			
		||||
        assertion = 
 | 
			
		||||
          (lib.length (lib.filter (x: x) [
 | 
			
		||||
            cfg.fish.enable or false
 | 
			
		||||
            cfg.zsh.enable or false
 | 
			
		||||
            cfg.bash.enable or false
 | 
			
		||||
          ]) <= 1); 
 | 
			
		||||
        message = "Only one user shell can be active in the configuration";
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue