Welcome to my Nix config!
- NixOS hosts are defined in
hosts/and composed from shared modules inmodules/nixos. - Home Manager configs live in
home/and compose shared modules inmodules/home(including desktop-specific pieces undermodules/home/desktop).
flake.nix: Wireshosts/andhome/via flake-parts and exposesnixosConfigurationsandhomeConfigurations.hosts/: One folder per host with adefault.nixplus hardware definitions.modules/nixos/: Shared NixOS modulescore/: Base system modules (boot, nix, networking, users, etc.).opt/: Feature toggles and optional stacks (fonts, vpn, desktop, etc.).
home/: Home Manager configs per user/host (e.g.home/roche/kiptum.nix).modules/home/: Shared Home Manager modulescore/: Base HM config, overlays, programs, and theming via Stylix.desktop/: Desktop stack (WM, services, shell/term, utilities, options).
scripts/: Helper scripts (e.g.scripts/deploy-nixos.sh).
- ArgoCD homelab configuration has moved out of this repository.
- The homelab Kubernetes manifests now live at
git@github.com:rochecompaan/homelab-k8s.git.
-
All hosts import a shared base defined by
modules/nixos/default.nix, which includes:modules/nixos/core/default.nix: Core modulesmodules/nixos/opt/default.nix: Optional/feature modules
-
Feature flags are declared in
modules/nixos/opt/options.nixand consumed by host configs. Typical host toggles:Example (hosts/kiptum/default.nix):
fonts.enable = truewayland.enable = truepipewire.enable = truedesktop = { enable = true; de = "niri"; }
-
Each host adds its own imports and overrides under
hosts/<name>/default.nix(hardware, Home Manager NixOS module, vendor-specific modules, etc.). -
Hosts are registered in
hosts/default.nixwhere a helpermkHostcomposesnixosConfigurations.<host>by stacking the shared modules with the host’s folder. External modules such asopenziti-nixanddiskoare added to all hosts here.
-
Shared HM base lives in
modules/home/core/default.nixand sets common environment, overlays, and theming glue. HM is enabled here. -
Desktop stack and options live under
modules/home/desktop/:options.nixexposesdefault.de,default.terminal,default.browser.- Submodules configure the selected WM (Hyprland/Niri), services and tools.
-
Per-host Home configs live in
home/roche/<hostname>.nixand typically:- Import Stylix and
modules/home(+modules/home/desktop). - Select desktop and terminal via
default.deanddefault.terminal. - Add host-specific tweaks (e.g. monitors/workspaces for Hyprland, Niri KDL snippets).
Examples:
home/roche/kiptum.nix: Setsdefault.de = "niri", tweaks Niri outputs.home/roche/kipchoge.nix: Setsdefault.de = "hyprland", dual-4k layout.
- Import Stylix and
- Create
hosts/<name>/default.nix(andhardware-configuration.nix). Import any needed modules (HM’s NixOS module, nixos-hardware, etc.) and set feature flags and desktop selection, e.g.:
networking.hostName = "<name>"fonts.enable = truewayland.enable = truepipewire.enable = truedesktop = { enable = true; de = "hyprland"; }
-
Register the host in
hosts/default.nixby adding it to thenixosConfigurationsset viamkHost "<name>". -
Optionally add it to
deploy.nodeswhen using deploy-rs for homelab and remote hosts.
- Create
home/roche/<name>.nixwith imports and choices, e.g.:
imports = [ inputs.stylix.homeModules.stylix ../../modules/home ../../modules/home/desktop ]theme = "gruvbox"default = { de = "hyprland"; terminal = "kitty"; }
- Register it in
home/default.nix:
"roche@<name>" = mkHome "<name>";
- Add any WM-specific tweaks in that file (Hyprland
monitor/workspace, Nirixdg.configFile."niri/config.kdl".text = lib.mkAfter '' ... '').
This flake exposes selected tools for use from other development flakes.
Use the raw Streamlinear CLI package without Home Manager token injection:
pkgs.mkShell {
packages = [ inputs.nixdots.packages.${pkgs.system}.streamlinear ];
}The raw package provides streamlinear-cli and streamlinear. Set
LINEAR_API_TOKEN in the consuming shell or service environment.
My config started as a fork of elythh/flake. Thank you elythh for the inpsiration!