forked from fabian/nix
		
	modularize baseline system configuration
This commit is contained in:
		
							parent
							
								
									80e5a5e8a6
								
							
						
					
					
						commit
						d5afd4b1a7
					
				
					 7 changed files with 107 additions and 70 deletions
				
			
		
							
								
								
									
										76
									
								
								sys/modules/baseline.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								sys/modules/baseline.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,76 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   pkgs, | ||||
|   ... | ||||
| }: | ||||
| with lib; let | ||||
|   cfg = config.local.sys.baseline; | ||||
| in { | ||||
|   options.local.sys.baseline = { | ||||
|     enable = mkEnableOption "Basic system settings"; | ||||
|   }; | ||||
|   config = mkIf cfg.enable { | ||||
|     system.stateVersion = "24.05"; # DO NOT CHANGE | ||||
| 
 | ||||
|     nix = { | ||||
|       package = pkgs.nixVersions.stable; | ||||
| 
 | ||||
|       extraOptions = '' | ||||
|         experimental-features = nix-command flakes | ||||
|       ''; | ||||
| 
 | ||||
|       # Not interested in the global flake registry | ||||
|       settings.flake-registry = ""; | ||||
|     }; | ||||
| 
 | ||||
|     console = { | ||||
|       keyMap = "us"; | ||||
|     }; | ||||
| 
 | ||||
|     programs = { | ||||
|       zsh.enable = true; | ||||
|       fuse.userAllowOther = true; | ||||
|     }; | ||||
| 
 | ||||
|     environment = { | ||||
|       pathsToLink = [ | ||||
|         "/share/zsh" | ||||
|       ]; | ||||
| 
 | ||||
|       systemPackages = with pkgs; | ||||
|         [ | ||||
|           git | ||||
|           vim | ||||
|         ] | ||||
|         ++ optionals (!config.boot.isContainer) [ | ||||
|           lm_sensors | ||||
|           lshw | ||||
|           parted | ||||
|           pciutils | ||||
|           smartmontools | ||||
|           usbutils | ||||
|         ]; | ||||
|     }; | ||||
| 
 | ||||
|     services = { | ||||
|       openssh.enable = mkDefault true; | ||||
| 
 | ||||
|       earlyoom = { | ||||
|         enable = mkDefault true; | ||||
|         enableNotifications = true; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     # Coredumps are a security risk and may use up a lot of disk space | ||||
|     systemd.coredump.extraConfig = '' | ||||
|       Storage=none | ||||
|       ProcessSizeMax=0 | ||||
|     ''; | ||||
| 
 | ||||
|     security.dhparams = { | ||||
|       enable = true; | ||||
|       defaultBitSize = 4096; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										10
									
								
								sys/modules/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								sys/modules/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   pkgs, | ||||
|   ... | ||||
| }: { | ||||
|   imports = [ | ||||
|     ./baseline.nix | ||||
|   ]; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue