A comprehensive Nix-based system configuration managed using numtide/blueprint. It provides a structured approach for NixOS, nix-darwin, and Home Manager across multiple machines.
- Core Technologies: Nix, NixOS, nix-darwin, Home Manager.
- Framework:
blueprint(automatically handles flake outputs based on directory structure). - Version Control: Jujutsu (
jj) is preferred.
Common operations are aliased for ease of use across different shells (Zsh, Fish, Nushell).
| Command | Action | Description |
|---|---|---|
hms |
home-manager switch --flake . |
Rebuild and activate Home Manager configuration. |
nrs |
sudo nixos-rebuild switch --flake . |
Rebuild and activate NixOS configuration (Linux only). |
drs |
darwin-rebuild switch --flake . |
Rebuild and activate nix-darwin configuration (macOS only). |
nd <name> |
nix develop .#<name> |
Enter a specific development shell (e.g., nd node22). |
Clone this repository to $HOME/.system-nix:
git clone https://github.com/cwilliams/.system-nix.git ~/.system-nix
# Or use jujutsu
jj git clone https://github.com/cwilliams/.system-nix.git ~/.system-nixFor a new installation, use the Custom Installer ISO or bootstrap from an existing NixOS system:
sudo nixos-rebuild switch --flake .#<hostname>Ensure Nix is installed (recommended: Determinate Systems Nix Installer), then run:
nix run nix-darwin -- switch --flake .#cwilliams-work-laptopNote: You may need to add --extra-experimental-features "nix-command flakes" if not already enabled.
Ensure Nix is installed (see Official Installation Instructions), then activate on a fresh system:
nix-shell -p home-manager --run "home-manager switch --extra-experimental-features nix-command --extra-experimental-features flakes --flake .#cwilliams@<hostname>"You can build a custom NixOS installer ISO that comes pre-configured with your system settings.
nix build .#nixosConfigurations.installer.config.system.build.isoImageThe resulting ISO will be in result/iso/.
You can test the entire installation process using QEMU:
./modules/home/scripts/test-iso-vm- Boot from the ISO: Flash to USB and boot. (Initial user:
cwilliams, password:nixos). - Partition Disks: Use
partedorfdiskto create EFI (FAT32), Swap, and Root (ext4) partitions. - Format and Mount:
sudo mkfs.fat -F 32 -n boot /dev/nvme0n1p1 sudo mkfs.ext4 -L nixos /dev/nvme0n1p3 sudo mount /dev/disk/by-label/nixos /mnt sudo mkdir -p /mnt/boot sudo mount /dev/disk/by-label/boot /mnt/boot
- Install:
sudo nixos-install --flake /etc/nix-config#cwilliams-laptop
hosts/<hostname>/: Entry points for each machine.modules/home/<domain>/: Functional domains (dev, ops, desktop, etc.) for user configuration. Seemodules/home/README.mdfor details.modules/home/home-shared.nix: Universal Home Manager user settings.modules/nixos/&modules/darwin/: System-level modules.modules/theming/: Shared styling.