NixOS dotfiles for multiple machines, built with the Den framework.
Den makes aspects the primary unit of composition. Shared behavior is defined once under den.default or den.aspects.*, then included by hosts and users as needed.
Host declarations live in modules/hosts/<hostname>/host.nix.
Build the installer ISO from this flake:
nix build .#installer
The ISO is written under ./result/iso/nixos-installer.iso.
Boot the target machine from the ISO, inspect disks with lsblk, then install with disko-install using the host configuration and target disk path:
disko-install --flake .#<host> --disk nixos /dev/disk-path
Replace <host> with pc, work, or laptop. Confirm the disk path and layout before editing or applying any disko.nix configuration.
flake.nix: generated file. Do not edit directly.flake.lock: pinned input revisions.modules/flake/: flake-level configuration, including Den and flake-file setup.modules/hosts/: host-specific Den aspects, hardware facts, and disk layouts.modules/users/: user-specific aspects and identity configuration.modules/nix/: Nix, nixpkgs, Home Manager, state version, and maintenance settings.modules/system/: shared OS-level features.modules/dev/: development tools and shell/editor configuration.modules/programs/: common user applications.modules/games/: game-related aspects.
The repository has a .envrc using nix-direnv. Run this once after cloning or changing the dev shell:
direnv allow
Without direnv, enter the shell manually:
nix develop
Apply the current host configuration:
nh os switch .
Apply a specific host configuration:
nh os switch .#(pc|work|laptop)
Format Nix files:
nix fmt .
flake.nix is generated by flake-file. If you change flake-file.* settings in the modules, regenerate it with:
nix run .#write-flake
Update flake inputs:
nix flake update