refactor(treewide): clean-up, flatten, rework module system
This commit is contained in:
		
							parent
							
								
									4ddf9d2b35
								
							
						
					
					
						commit
						5590c8a951
					
				
					 58 changed files with 397 additions and 635 deletions
				
			
		|  | @ -1,9 +1,13 @@ | |||
| { config, lib, ... }: | ||||
| { config, lib, osConfig, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.ooknet.console.shell.bash; | ||||
|   inherit (lib) mkIf; | ||||
|   cfg = config.ooknet.shell.bash; | ||||
|   admin = osConfig.ooknet.host.admin; | ||||
| in | ||||
| 
 | ||||
| { | ||||
|   config = lib.mkIf cfg.enable { | ||||
|   config = mkIf (cfg.enable || admin.shell == "bash") { | ||||
|     programs.bash.enable = true; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -1,17 +1,7 @@ | |||
| { lib, ... }: | ||||
| { | ||||
|   imports = [ | ||||
|     ./fish | ||||
|     ./bash | ||||
|     ./zsh | ||||
|   ]; | ||||
| 
 | ||||
|   options.ooknet.console.shell = { | ||||
|     fish = { | ||||
|       enable = lib.mkEnableOption "Enable fish configuration"; | ||||
|     }; | ||||
|     bash = { | ||||
|       enable = lib.mkEnableOption "Enable bash configuration"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -1,14 +1,15 @@ | |||
| { lib, config, ... }: | ||||
| { lib, config, osConfig, ... }: | ||||
| let | ||||
|   cfg = config.ooknet.console.shell.fish; | ||||
|   inherit (lib) mkIf; | ||||
|   hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages; | ||||
|   inherit (lib) mkIf any; | ||||
|   cfg = config.ooknet.shell.fish; | ||||
|   admin = osConfig.ooknet.host.admin; | ||||
|   hasPackage = pname: any (p: p ? pname && p.pname == pname) config.home.packages; | ||||
|   hasEza = hasPackage "eza"; | ||||
|   hasBat = hasPackage "bat"; | ||||
| in | ||||
| { | ||||
|   config = { | ||||
|     programs.fish = mkIf cfg.enable { | ||||
|   config = mkIf (cfg.enable || admin.shell == "fish") { | ||||
|     programs.fish = { | ||||
|       enable = true; | ||||
|       shellAbbrs = { | ||||
|         fe = "cd $FLAKE; $EDITOR $FLAKE"; | ||||
|  |  | |||
|  | @ -1,14 +1,13 @@ | |||
| { lib, config, ... }: | ||||
| { lib, config, osConfig, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkIf mkEnableOption; | ||||
|   cfg = config.ooknet.console.shell.zsh; | ||||
|   inherit (lib) mkIf; | ||||
|   cfg = config.ooknet.shell.zsh; | ||||
|   admin = osConfig.ooknet.host.admin; | ||||
| in | ||||
| 
 | ||||
| { | ||||
|   options.ooknet.console.shell.zsh.enable = mkEnableOption ""; | ||||
| 
 | ||||
|   config = mkIf cfg.enable { | ||||
|   config = mkIf (cfg.enable || admin.shell == "zsh") { | ||||
|     programs.zsh = { | ||||
|       enable = true; | ||||
|       autocd = true; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue