mirror of
				https://github.com/bartvdbraak/dotfiles.git
				synced 2025-10-29 22:59:09 +00:00 
			
		
		
		
	Increase modularity of configuration
This commit is contained in:
		
							parent
							
								
									ab876da423
								
							
						
					
					
						commit
						bb897d5682
					
				
					 4 changed files with 94 additions and 67 deletions
				
			
		|  | @ -3,18 +3,22 @@ | ||||||
| { | { | ||||||
|   imports = [ |   imports = [ | ||||||
|     ./hardware-configuration.nix |     ./hardware-configuration.nix | ||||||
|  |     ./users.nix             # Import user-specific config | ||||||
|  |     ./packages.nix          # Import package-specific config | ||||||
|  |     ./services.nix          # Import services config | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|  |   # Bootloader and EFI settings | ||||||
|   boot.loader.systemd-boot.enable = true; |   boot.loader.systemd-boot.enable = true; | ||||||
|   boot.loader.efi.canTouchEfiVariables = true; |   boot.loader.efi.canTouchEfiVariables = true; | ||||||
| 
 | 
 | ||||||
|  |   # Hostname and networking | ||||||
|   networking.hostName = "tongfang"; |   networking.hostName = "tongfang"; | ||||||
|   networking.networkmanager.enable = true; |   networking.networkmanager.enable = true; | ||||||
| 
 | 
 | ||||||
|  |   # Time and locale settings | ||||||
|   time.timeZone = "Europe/Amsterdam"; |   time.timeZone = "Europe/Amsterdam"; | ||||||
| 
 |  | ||||||
|   i18n.defaultLocale = "en_US.UTF-8"; |   i18n.defaultLocale = "en_US.UTF-8"; | ||||||
| 
 |  | ||||||
|   i18n.extraLocaleSettings = { |   i18n.extraLocaleSettings = { | ||||||
|     LC_ADDRESS = "nl_NL.UTF-8"; |     LC_ADDRESS = "nl_NL.UTF-8"; | ||||||
|     LC_IDENTIFICATION = "nl_NL.UTF-8"; |     LC_IDENTIFICATION = "nl_NL.UTF-8"; | ||||||
|  | @ -27,77 +31,18 @@ | ||||||
|     LC_TIME = "en_US.UTF-8"; |     LC_TIME = "en_US.UTF-8"; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   services.xserver.enable = false; |   # Fonts configuration | ||||||
|   services.displayManager.sddm.enable = true; |   fonts = { | ||||||
|   services.displayManager.sddm.wayland.enable = true; |     enableDefaultPackages = true; | ||||||
|   services.desktopManager.plasma6.enable = true; |  | ||||||
| 
 |  | ||||||
|   services.xserver.xkb = { |  | ||||||
|     layout = "us"; |  | ||||||
|     variant = ""; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   services.printing.enable = false; |  | ||||||
|   hardware.bluetooth.enable = true; |  | ||||||
| 
 |  | ||||||
|   hardware.pulseaudio.enable = false; |  | ||||||
|   security.rtkit.enable = true; |  | ||||||
|   services.pipewire = { |  | ||||||
|     enable = true; |  | ||||||
|     alsa.enable = true; |  | ||||||
|     alsa.support32Bit = true; |  | ||||||
|     pulse.enable = true; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   services.libinput.enable = true; |  | ||||||
| 
 |  | ||||||
|   nixpkgs.config.permittedInsecurePackages = [ |  | ||||||
|     "electron-27.3.11" |  | ||||||
|   ]; |  | ||||||
|    |  | ||||||
|   users.users.bart = { |  | ||||||
|     isNormalUser = true; |  | ||||||
|     description = "Bart van der Braak"; |  | ||||||
|     extraGroups = [ "networkmanager" "wheel" ]; |  | ||||||
|     packages = with pkgs; [ |     packages = with pkgs; [ | ||||||
|       vscodium |       jetbrains-mono | ||||||
|       thunderbird |  | ||||||
|       fastfetch |  | ||||||
|       wezterm |  | ||||||
|       neovim |  | ||||||
|       logseq |  | ||||||
|       element-desktop |  | ||||||
|       opentofu |  | ||||||
|       python3 |  | ||||||
|       gnumake |  | ||||||
|     ]; |     ]; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   services.tailscale.enable = true; |   # Enable Nix Flakes and experimental features | ||||||
|    |  | ||||||
|   nixpkgs.config.allowUnfree = true; |   nixpkgs.config.allowUnfree = true; | ||||||
|   nix.settings.experimental-features = [ "nix-command" "flakes" ]; |   nix.settings.experimental-features = [ "nix-command" "flakes" ]; | ||||||
| 
 | 
 | ||||||
|   environment.systemPackages = with pkgs; with inputs; [ |   # System state version | ||||||
|     inputs.zen-browser.packages."${system}".default |  | ||||||
|     firefox |  | ||||||
|     git |  | ||||||
|     vim |  | ||||||
|     wget |  | ||||||
|     curl |  | ||||||
|     fzf |  | ||||||
|     jq |  | ||||||
|     ripgrep |  | ||||||
|   ]; |  | ||||||
|   environment.variables = { |  | ||||||
|     EDITOR = "vim"; |  | ||||||
|     ELECTRON_OZONE_PLATFORM_HINT = "wayland"; |  | ||||||
|     NIXOS_OZONE_WL = "1"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   fonts.packages = with pkgs; [ |  | ||||||
|     jetbrains-mono |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   system.stateVersion = "24.05"; |   system.stateVersion = "24.05"; | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								tongfang/nixos/packages.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tongfang/nixos/packages.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | ||||||
|  | { pkgs, inputs, config, ... }: | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   environment.systemPackages = with pkgs; with inputs; [ | ||||||
|  |     inputs.zen-browser.packages."${system}".default | ||||||
|  |     firefox | ||||||
|  |     git | ||||||
|  |     vim | ||||||
|  |     wget | ||||||
|  |     curl | ||||||
|  |     fzf | ||||||
|  |     jq | ||||||
|  |     ripgrep | ||||||
|  |   ]; | ||||||
|  | } | ||||||
							
								
								
									
										41
									
								
								tongfang/nixos/services.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								tongfang/nixos/services.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,41 @@ | ||||||
|  | { pkgs, ... }: | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   # X11 is disabled, but we're using SDDM with Wayland | ||||||
|  |   services.xserver.enable = false; | ||||||
|  |   services.displayManager.sddm.enable = true; | ||||||
|  |   services.displayManager.sddm.wayland.enable = true; | ||||||
|  |   services.desktopManager.plasma6.enable = true; | ||||||
|  | 
 | ||||||
|  |   # Audio system with PipeWire | ||||||
|  |   # Enable PipeWire and ALSA support | ||||||
|  |   services.pipewire = { | ||||||
|  |     enable = true; | ||||||
|  |     alsa.enable = true;       # Enable ALSA support | ||||||
|  |     alsa.support32Bit = true; # Support for 32-bit applications | ||||||
|  |     pulse.enable = true;      # Enable PulseAudio compatibility layer | ||||||
|  |   }; | ||||||
|  |    | ||||||
|  |   # Enable libinput for input device handling | ||||||
|  |   services.libinput.enable = true; | ||||||
|  | 
 | ||||||
|  |   # Enable security-related service for realtime audio tasks | ||||||
|  |   security.rtkit.enable = true; | ||||||
|  | 
 | ||||||
|  |   # Steam, Tailscale, and other services | ||||||
|  |   programs.steam.enable = true; | ||||||
|  |   services.tailscale.enable = true; | ||||||
|  | 
 | ||||||
|  |   # Environment variables | ||||||
|  |   environment.variables = { | ||||||
|  |     EDITOR = "vim"; | ||||||
|  |     ELECTRON_OZONE_PLATFORM_HINT = "wayland"; | ||||||
|  |     NIXOS_OZONE_WL = "1"; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   # Printing and Bluetooth | ||||||
|  |   # Disable browsed: https://discourse.nixos.org/t/newly-announced-vulnerabilities-in-cups | ||||||
|  |   services.printing.enable = true; | ||||||
|  |   services.printing.browsed.enable = false; | ||||||
|  |   hardware.bluetooth.enable = true; | ||||||
|  | } | ||||||
							
								
								
									
										26
									
								
								tongfang/nixos/users.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								tongfang/nixos/users.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | ||||||
|  | { config, pkgs, ... }: | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   users.users.bart = { | ||||||
|  |     isNormalUser = true; | ||||||
|  |     description = "Bart van der Braak"; | ||||||
|  |     extraGroups = [ "networkmanager" "wheel" ]; | ||||||
|  |     packages = with pkgs; [ | ||||||
|  |       vscodium | ||||||
|  |       thunderbird | ||||||
|  |       fastfetch | ||||||
|  |       wezterm | ||||||
|  |       neovim | ||||||
|  |       logseq | ||||||
|  |       element-desktop | ||||||
|  |       opentofu | ||||||
|  |       python3 | ||||||
|  |       gnumake | ||||||
|  |     ]; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   nixpkgs.config.permittedInsecurePackages = [ | ||||||
|  |     # Workaround for electron dependency in Logseq | ||||||
|  |     "electron-27.3.11" | ||||||
|  |   ]; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue