This repo contains my complete system configuration for a declarative, reproducible, and minimal NixOS setup — tailored for daily development, Kubernetes home-ops, WSL2 integration, and soothing Catppuccin-based fish shell theming.
- ❄️ Nix flakes: Modular, composable, version-locked
- 🐟 Fish shell: Minimal
fishshell setup with soothingCatppuccincolours and aStarshipprompt. - 🔐 Secrets management: Secrets encrypted and managed with
opnix - 🧰 WSL2-friendly: Tested extensively in Windows Subsystem for Linux
- 🧪 Development modules: Streamlined development environments for multiple languages and tools
- 🧩 Custom packages: Custom
nixpkgsoverlays and pkgs managed declaratively
The repository uses a dendritic flake-parts layout, with configuration grouped
by purpose under modules/.
.
├── flake.nix # Inputs and the flake-parts/import-tree bootstrap
├── flake.lock # Locked dependencies
└── modules/
├── flake/ # Internal model, host assembly, nixpkgs, and treefmt
├── home/ # Reusable Home Manager features and host fragments
├── hosts/ # Host metadata, hardware, and host-specific NixOS modules
├── nixos/ # Shared NixOS features
├── overlays/ # Private package-set overlays
├── packages/ # Exported packages, recipes, and generated sources
└── users/ # Per-user NixOS accounts and Home Manager defaults
flake.nix delegates composition to flake-parts. import-tree automatically
imports every maintained Nix file below modules/ as a flake-parts module.
Paths containing an underscore-prefixed segment are excluded; these hold raw
NixOS modules, package recipes and sources, assets, or application config that
must be imported explicitly.
Modules merge into the private internal namespace. modules/flake/hosts.nix
turns that model into the public nixosConfigurations.{laptop,gamer,work}
outputs and embeds Home Manager for stianrs. The concrete account and personal
Home Manager defaults live under modules/users/stianrs/. Shared NixOS and Home
Manager modules apply to every host, while host-specific fragments are selected
by the output name. Desktop Home Manager modules are omitted from the WSL host.
The package overlay combines local recipes, stable aliases, and an unstable
package set. The resulting package set is shared by NixOS, Home Manager, and
the exported packages.x86_64-linux outputs.
This repository contains hardware configuration for the physical laptop and
gamer hosts, plus the work NixOS-WSL host. Only deploy an output to its
matching machine; a new machine with different disks or hardware needs its own
host and generated hardware module first.
-
Install a minimal NixOS system from the ISO/USB installer and boot into it. Ensure the
stianrsuser exists and can usesudo. -
Install Git temporarily and clone the repository at the path expected by
programs.nh.flake:nix-shell -p git git clone https://github.com/rodent1/nix /home/stianrs/nix exit -
Apply the matching host output. Replace
gamerwithlaptopas appropriate:sudo nixos-rebuild switch \ --flake /home/stianrs/nix#gamer \ --option experimental-features "nix-command flakes"The first activation installs Home Manager,
nh, andopnix. OpNix safely skips secret retrieval while its user token is absent. -
Store the 1Password service-account token as the user. The
-pathoption must appear before thesetsubcommand:mkdir -p ~/.config/opnix opnix token -path "$HOME/.config/opnix/token" set chmod 600 ~/.config/opnix/token
-
Activate once more to retrieve Home Manager secrets:
nh os switch
Install NixOS-WSL using its documented distribution/import process first. Once
the WSL instance has a working Nix installation and the stianrs user, clone
this repository to /home/stianrs/nix and apply the WSL output:
nix-shell -p git
git clone https://github.com/rodent1/nix /home/stianrs/nix
exit
sudo nixos-rebuild switch \
--flake /home/stianrs/nix#work \
--option experimental-features "nix-command flakes"Install the user-scoped OpNix token as described above, then run:
nh os switchSubsequent rebuilds can use nh os switch while the repository remains at
/home/stianrs/nix and the checkout contains the intended branch or revision.
These commands require Nix with flakes enabled. This flake supports only
x86_64-linux, with the gamer, laptop, and work hosts and the flate,
kubectl-kopiur, and wagoapp packages.
Inspect all supported outputs:
nix flake show --all-systemsEvaluate the flake without building derivations for a lightweight check, or run the full flake check when builds are appropriate:
nix flake check --no-build
nix flake checkBuild the exact system closure for the host being changed, replacing gamer
with laptop or work when appropriate:
nix build .#nixosConfigurations.gamer.config.system.build.toplevelBuild an exported package by name, for example:
nix build .#flateThe complete exported package list is flate, kubectl-kopiur, and wagoapp.
On configured machines using this repository at /home/stianrs/nix, activate
the checkout with:
nh os switchUnlike the inspection and build commands, activation changes the running system. It is for machines already configured from this checkout, not for a fresh installation. See AGENTS.md for contributor-oriented module, package, and CI verification guidance.
Built on the shoulders of those who came before me
Built with love, flakes and frustration. ♥