My NixOS configuration (WORK IN PROGRESS; probably unusable)
nix nixos config

successful refactoring???

+328 -48
+111 -3
flake.lock
··· 7 7 ] 8 8 }, 9 9 "locked": { 10 - "lastModified": 1758463745, 11 - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", 10 + "lastModified": 1763992789, 11 + "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", 12 12 "owner": "nix-community", 13 13 "repo": "home-manager", 14 - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", 14 + "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", 15 15 "type": "github" 16 16 }, 17 17 "original": { ··· 21 21 "type": "github" 22 22 } 23 23 }, 24 + "niri": { 25 + "inputs": { 26 + "niri-stable": "niri-stable", 27 + "niri-unstable": "niri-unstable", 28 + "nixpkgs": [ 29 + "nixpkgs" 30 + ], 31 + "nixpkgs-stable": "nixpkgs-stable", 32 + "xwayland-satellite-stable": "xwayland-satellite-stable", 33 + "xwayland-satellite-unstable": "xwayland-satellite-unstable" 34 + }, 35 + "locked": { 36 + "lastModified": 1764008093, 37 + "narHash": "sha256-8OmHLuPkZMjjEkn/TA2tk/3tEOE+zoUYiP5YFk7JsrU=", 38 + "owner": "sodiboo", 39 + "repo": "niri-flake", 40 + "rev": "340b81b5d7cb4f15bf23f9ae8e372366c06fd423", 41 + "type": "github" 42 + }, 43 + "original": { 44 + "owner": "sodiboo", 45 + "repo": "niri-flake", 46 + "type": "github" 47 + } 48 + }, 49 + "niri-stable": { 50 + "flake": false, 51 + "locked": { 52 + "lastModified": 1756556321, 53 + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", 54 + "owner": "YaLTeR", 55 + "repo": "niri", 56 + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", 57 + "type": "github" 58 + }, 59 + "original": { 60 + "owner": "YaLTeR", 61 + "ref": "v25.08", 62 + "repo": "niri", 63 + "type": "github" 64 + } 65 + }, 66 + "niri-unstable": { 67 + "flake": false, 68 + "locked": { 69 + "lastModified": 1763990232, 70 + "narHash": "sha256-RdtlZ+nufSwEgNsF0yuTOO2eGpn87Qm9b3tRQPsibH4=", 71 + "owner": "YaLTeR", 72 + "repo": "niri", 73 + "rev": "45b45ac29d654c0e6759ab996c69dfde40053536", 74 + "type": "github" 75 + }, 76 + "original": { 77 + "owner": "YaLTeR", 78 + "repo": "niri", 79 + "type": "github" 80 + } 81 + }, 24 82 "nixpkgs": { 25 83 "locked": { 26 84 "lastModified": 1763622513, ··· 37 95 "type": "github" 38 96 } 39 97 }, 98 + "nixpkgs-stable": { 99 + "locked": { 100 + "lastModified": 1763948260, 101 + "narHash": "sha256-dY9qLD0H0zOUgU3vWacPY6Qc421BeQAfm8kBuBtPVE0=", 102 + "owner": "NixOS", 103 + "repo": "nixpkgs", 104 + "rev": "1c8ba8d3f7634acac4a2094eef7c32ad9106532c", 105 + "type": "github" 106 + }, 107 + "original": { 108 + "owner": "NixOS", 109 + "ref": "nixos-25.05", 110 + "repo": "nixpkgs", 111 + "type": "github" 112 + } 113 + }, 40 114 "root": { 41 115 "inputs": { 42 116 "home-manager": "home-manager", 117 + "niri": "niri", 43 118 "nixpkgs": "nixpkgs" 119 + } 120 + }, 121 + "xwayland-satellite-stable": { 122 + "flake": false, 123 + "locked": { 124 + "lastModified": 1755491097, 125 + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", 126 + "owner": "Supreeeme", 127 + "repo": "xwayland-satellite", 128 + "rev": "388d291e82ffbc73be18169d39470f340707edaa", 129 + "type": "github" 130 + }, 131 + "original": { 132 + "owner": "Supreeeme", 133 + "ref": "v0.7", 134 + "repo": "xwayland-satellite", 135 + "type": "github" 136 + } 137 + }, 138 + "xwayland-satellite-unstable": { 139 + "flake": false, 140 + "locked": { 141 + "lastModified": 1763704521, 142 + "narHash": "sha256-ceYEV6PnvUN8Zixao4gpPuN+VT3B0SlAXKuPNHZhqUY=", 143 + "owner": "Supreeeme", 144 + "repo": "xwayland-satellite", 145 + "rev": "f379ff5722a821212eb59ada9cf8e51cb3654aad", 146 + "type": "github" 147 + }, 148 + "original": { 149 + "owner": "Supreeeme", 150 + "repo": "xwayland-satellite", 151 + "type": "github" 44 152 } 45 153 } 46 154 },
+38 -11
flake.nix
··· 8 8 url = "github:nix-community/home-manager/release-25.05"; 9 9 inputs.nixpkgs.follows = "nixpkgs"; 10 10 }; 11 + 12 + niri = { 13 + url = "github:sodiboo/niri-flake"; 14 + inputs.nixpkgs.follows = "nixpkgs"; 15 + }; 11 16 }; 12 17 13 18 outputs = { 14 19 self, 15 20 nixpkgs, 16 21 home-manager, 22 + niri, 17 23 ... 18 - }@inputs: { 19 - nixosConfigurations.mini = nixpkgs.lib.nixosSystem { 20 - modules = [ 21 - # default configuration for now 22 - ./hosts/mini/configuration.nix 24 + } @ inputs: let 25 + lib = nixpkgs.lib; 23 26 24 - home-manager.nixosModules.home-manager { 25 - home-manager.useGlobalPkgs = true; 26 - home-manager.useUserPackages = true; 27 + supportedSystems = ["x86_64-linux"]; 28 + forAllSystems = func: 29 + lib.genAttrs supportedSystems ( 30 + system: func nixpkgs.legacyPackages.${system} 31 + ); 27 32 28 - home-manager.users.jordan = import ./home.nix; 29 - } 30 - ]; 33 + createSystem = { 34 + host, 35 + user, 36 + }: 37 + lib.nixosSystem { 38 + specialArgs = { inherit (inputs) self; }; 39 + modules = [ 40 + ./hosts/${host} 41 + ./users/${user} 42 + home-manager.nixosModules.home-manager 43 + niri.nixosModules.niri 44 + { 45 + home-manager.useGlobalPkgs = true; 46 + home-manager.useUserPackages = true; 47 + home-manager.extraSpecialArgs = { inherit (inputs) self; }; 48 + home-manager.users.${user} = import ./users/${user}/home.nix; 49 + } 50 + ]; 51 + }; 52 + in { 53 + nixosConfigurations = { 54 + mini = createSystem { 55 + host = "mini"; 56 + user = "jordan"; 57 + }; 31 58 }; 32 59 }; 33 60 }
+4
home.nix
··· 17 17 swaybg 18 18 ]; 19 19 20 + programs.niri = { 21 + enable = true; 22 + }; 23 + 20 24 programs.alacritty.enable = true; 21 25 programs.fuzzel.enable = true; 22 26 programs.swaylock.enable = true;
+4 -34
hosts/mini/configuration.nix
··· 1 - # Edit this configuration file to define what should be installed on 2 - # your system. Help is available in the configuration.nix(5) man page 3 - # and in the NixOS manual (accessible by running ‘nixos-help’). 4 - 5 1 { config, pkgs, ... }: 6 2 7 3 { 8 - imports = 9 - [ # Include the results of the hardware scan. 10 - ./hardware-configuration.nix 11 - ]; 4 + imports = [ 5 + ./hardware-configuration.nix 6 + ]; 12 7 13 - # Bootloader. 14 8 boot.loader.systemd-boot.enable = true; 15 9 boot.loader.efi.canTouchEfiVariables = true; 16 10 17 - networking.hostName = "mini"; # Define your hostname. 18 - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 19 - 20 - # Configure network proxy if necessary 21 - # networking.proxy.default = "http://user:password@proxy:port/"; 22 - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 11 + networking.hostName = "mini"; 23 12 24 - # Enable networking 25 13 networking.networkmanager.enable = true; 26 14 27 - # Set your time zone. 28 15 time.timeZone = "America/New_York"; 29 16 30 - # Select internationalisation properties. 31 17 i18n.defaultLocale = "en_US.UTF-8"; 32 18 33 19 i18n.extraLocaleSettings = { ··· 42 28 LC_TIME = "en_US.UTF-8"; 43 29 }; 44 30 45 - # Enable the X11 windowing system. 46 - #services.xserver.enable = true; 47 - 48 - # Enable the GNOME Desktop Environment. 49 - # services.xserver.displayManager.gdm.enable = true; 50 - # services.xserver.desktopManager.gnome.enable = true; 51 - 52 - programs.niri.enable = true; 53 - 54 - # Configure keymap in X11 55 31 services.xserver.xkb = { 56 32 layout = "us"; 57 33 variant = ""; 58 34 }; 59 35 60 - # Enable CUPS to print documents. 61 36 services.printing.enable = true; 62 37 63 - # Enable sound with pipewire. 64 38 services.pulseaudio.enable = false; 65 39 security.rtkit.enable = true; 66 40 services.pipewire = { ··· 76 50 #media-session.enable = true; 77 51 }; 78 52 79 - # Enable touchpad support (enabled default in most desktopManager). 80 - # services.xserver.libinput.enable = true; 81 - 82 - # Define a user account. Don't forget to set a password with ‘passwd’. 83 53 users.users.jordan = { 84 54 isNormalUser = true; 85 55 description = "Jordan Reger";
+17
hosts/mini/default.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + imports = [ 5 + ./hardware-configuration.nix 6 + ../../modules/nixos 7 + ]; 8 + 9 + boot.loader.systemd-boot.enable = true; 10 + boot.loader.efi.canTouchEfiVariables = true; 11 + 12 + networking.hostName = "mini"; 13 + 14 + networking.networkmanager.enable = true; 15 + 16 + system.stateVersion = "25.05"; 17 + }
+17
modules/home/default.nix
··· 1 + {pkgs, ...}: { 2 + home = { 3 + packages = with pkgs; [ 4 + file 5 + tree 6 + which 7 + zstd 8 + nixd 9 + nil 10 + btop 11 + alacritty 12 + ]; 13 + stateVersion = "25.05"; 14 + }; 15 + 16 + programs.home-manager.enable = true; 17 + }
+75
modules/nixos/default.nix
··· 1 + { 2 + self, 3 + pkgs, 4 + lib, 5 + ... 6 + }: { 7 + nix.gc = { 8 + automatic = true; 9 + dates = lib.mkDefault "weekly"; 10 + options = lib.mkDefault "--delete-older-than 7d"; 11 + }; 12 + 13 + nixpkgs.config = { 14 + allowUnfree = true; 15 + }; 16 + 17 + time.timeZone = "America/New_York"; 18 + i18n = { 19 + defaultLocale = "en_US.UTF-8"; 20 + extraLocaleSettings = { 21 + LC_ADDRESS = "en_US.UTF-8"; 22 + LC_IDENTIFICATION = "en_US.UTF-8"; 23 + LC_MEASUREMENT = "en_US.UTF-8"; 24 + LC_MONETARY = "en_US.UTF-8"; 25 + LC_NAME = "en_US.UTF-8"; 26 + LC_NUMERIC = "en_US.UTF-8"; 27 + LC_PAPER = "en_US.UTF-8"; 28 + LC_TELEPHONE = "en_US.UTF-8"; 29 + LC_TIME = "en_US.UTF-8"; 30 + }; 31 + }; 32 + 33 + security.polkit.enable = true; 34 + 35 + services = { 36 + xserver.xkb = { 37 + layout = "us"; 38 + variant = ""; 39 + }; 40 + 41 + printing.enable = true; 42 + 43 + openssh = { 44 + enable = true; 45 + settings = { 46 + X11Forwarding = true; 47 + PermitRootLogin = "no"; 48 + PasswordAuthentication = false; 49 + }; 50 + }; 51 + 52 + pulseaudio.enable = false; 53 + pipewire = { 54 + enable = true; 55 + alsa.enable = true; 56 + alsa.support32Bit = true; 57 + pulse.enable = true; 58 + jack.enable = true; 59 + }; 60 + }; 61 + 62 + programs.dconf.enable = true; 63 + 64 + environment = { 65 + systemPackages = with pkgs; [ 66 + helix 67 + wget 68 + curl 69 + git 70 + zip 71 + unzip 72 + ]; 73 + variables.EDITOR = "hx"; 74 + }; 75 + }
+29
modules/nixos/niri.nix
··· 1 + {pkgs, ...}: { 2 + programs.niri = { 3 + enable = true; 4 + package = pkgs.niri; 5 + } 6 + 7 + environment.systemPackages = with pkgs; [ 8 + nautilus 9 + nautilus-nautilus-open-any-terminal 10 + ]; 11 + 12 + xdg.portal = { 13 + extraPortals = with pkgs; [ 14 + xdg-desktop-portal-gnome 15 + xdg-desktop-portal-gtk 16 + gnome-keyring 17 + ]; 18 + 19 + config = { 20 + niri = { 21 + default = ["gnome" "gtk"]; 22 + 23 + "org.freedesktop.impl.portal.Access" = ["gtk"]; 24 + "org.freedesktop.impl.portal.Notification" = ["gtk"]; 25 + "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; 26 + }; 27 + }; 28 + }; 29 + }
+5
modules/nixos/overlays.nix
··· 1 + {self, pkgs, ...}: { 2 + nixpkgs.overlays = [ 3 + self.inputs.niri.overlays.niri 4 + ]; 5 + }
+7
users/jordan/default.nix
··· 1 + {...}: { 2 + users.users.jordan = { 3 + isNormalUser = true; 4 + description = "Jordan Reger"; 5 + extraGroups = ["networkmanager" "wheel"]; 6 + }; 7 + }
+10
users/jordan/home.nix
··· 1 + {...}: { 2 + imports = [ 3 + ../../modules/home 4 + 5 + ./settings 6 + ]; 7 + 8 + home.username = "jordan"; 9 + home.homeDirectory = "/home/jordan"; 10 + }
+5
users/jordan/settings/default.nix
··· 1 + {...}: { 2 + imports = [ 3 + ./git.nix 4 + ]; 5 + }
+6
users/jordan/settings/git.nix
··· 1 + {...}: { 2 + programs.git = { 3 + userName = "Jordan Reger"; 4 + userEmail = "jordan@reger.co"; 5 + }; 6 + }