A modular NixOS desktop configuration for an x86_64 laptop/desktop with Hyprland, Home Manager, NetworkManager, PipeWire, gaming support, development tools, and selectable desktop shells.
flake.nixdefines thenixossystem and pins external inputs.hardware-configuration.nixis a portable placeholder; the installer replaces it with the target machine's generated hardware file.vars.nixcontains the username, identity, desktop shell, browser, terminal, and wallpaper defaults.hosts/nixos/default.nixis the host manifest.modules/system/contains boot, hardware, locale, networking, audio, user, and security settings.modules/desktop/contains system-level Hyprland and shell enablement.modules/packages/contains package groups and optional services.home/contains Home Manager configuration for Hyprland, Fish, and the selectable shell.Experimental/install.shis an interactive installer for a fresh NixOS system.
The repository expects the machine-generated hardware file at its root. From a NixOS installer or an existing NixOS system:
sudo mv /etc/nixos /etc/nixos.backup
sudo git clone https://github.com/mattsva/easynixos.git /etc/nixos
sudo nixos-generate-config --show-hardware-config \
> /etc/nixos/hardware-configuration.nix
sudoedit /etc/nixos/vars.nix
sudo nixos-rebuild switch --flake /etc/nixos#nixosThe checked-in hardware file contains no disk identifiers or personal machine data, so it is safe to publish but is not a bootable hardware definition by itself. Generate a hardware file for the target machine before rebuilding; it supplies filesystems, swap, and initrd modules. The installer automates these steps and also enables flakes, but it remains in Experimental/ because it is interactive and moves or backs up /etc/nixos.
At minimum, verify these values in vars.nix:
userName,userEmail, andgitNamelocation.timezonebrowser,terminal, andfileManagerwallpaperDirandwallpaperFiledesktopShell:caelestia,noctalia,dank, orend4-dotshyprConfig: currentlyhyprlangis recommended
The Fish configuration provides these abbreviations:
| Abbreviation | Command |
|---|---|
nr |
Rebuild and activate /etc/nixos#nixos |
nrt |
Test a rebuild without changing the boot entry |
nrb |
Build the next boot entry |
nfu |
Update the flake inputs in /etc/nixos |
update |
Update inputs, then rebuild /etc/nixos#nixos |
ncg |
Remove old Nix store generations |
gpu |
Run a command through nvidia-offload |
The installed system is expected to be the working copy at /etc/nixos. When developing from another checkout, sync or copy deliberate changes into /etc/nixos before running update; the command no longer uses a machine-specific absolute source path or deletes the installed configuration from an arbitrary directory.
Set desktopShell in vars.nix and rebuild. The selected shell is configured in both the system and Home Manager layers:
caelestiais the current default and uses the Caelestia flake modules.noctaliauses the Noctalia package and Home Manager module.dankuses DankMaterialShell’s Home Manager module.end4-dotsuses the end4-dots / end4-inspired Hyprland flow with the same launcher and clipboard conventions.
Hyprland keybindings use the configured terminal, file manager, browser, and shell commands. Monitor definitions in home/hyprland.nix are examples for the current machine and should be adjusted for different displays.
NetworkManager, systemd-resolved, randomized Wi-Fi MAC addresses, Tailscale client mode, Tor client mode, KDE Connect, and the FortiSSL NetworkManager plugin are enabled. The firewall is enabled with KDE Connect ports limited to LAN-style interfaces, Tailscale’s WireGuard port, and service ports on tailscale0. Avahi opens mDNS for printer discovery.
SSH and Searx are not enabled by default. Open WebUI is declared but disabled. Enable services deliberately, provide secrets through a local-only module, and add only the corresponding firewall rules. AppArmor, conservative kernel sysctls, polkit, password-required sudo, and restricted namespaces are enabled.
The configuration includes PipeWire/Bluetooth, CUPS and common printer drivers, Flatpak with Flathub, Steam and Proton support, Docker, VirtualBox, Ollama with CUDA, offline Kiwix tooling, development toolchains, and security/research utilities. Searx is present but disabled until a local secret is supplied. Several packages are intentionally heavyweight; remove a package group from hosts/nixos/default.nix if a smaller installation is desired.
Run these commands on NixOS after changing the configuration:
nix flake check
sudo nixos-rebuild dry-build --flake .#nixos
nixfmt --check flake.nix hosts modules home vars.nix hardware-configuration.nix
bash -n Experimental/install.shThe configuration targets x86_64-linux. The checked-in flake.lock must be refreshed with nix flake update whenever flake inputs are added or changed.
MIT. See LICENSE.