- Nix 63.3%
- Python 17.1%
- Lua 9.5%
- Shell 9.1%
- CSS 1%
| docs | ||
| home | ||
| hosts | ||
| modules | ||
| secrets | ||
| .envrc | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .sops.yaml | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
nixos-config
NixOS flake. Configures the QEMU/libvirt VM today; the ThinkPad P15 and Panasonic CF-SV1 join later.
Layout
flake.nix: nixpkgs pinned to nixos-26.05, home-manager as a NixOS module, onenixosConfigurations.<host>entry per host.hosts/<name>/: host identity: hostname,system.stateVersion, kernel choice,custom.*toggles, disk parameters.modules/: shared modules. Options are declared inmodules/options.nixundercustom.*; the optional parts gate on them (custom.ssh,custom.desktop,custom.vm,custom.btrfs).home/: home-manager packages for niyari.home/default.nixis shared,home/vm.nixis host-specific.docs/superpowers/: specs and plans.
hosts/vm runs the latest kernel and carries an lts-kernel
specialisation, tagged LTS in the boot menu.
Building
Inside the VM (the flake can live anywhere, e.g. ~/nixos-config; it
does not need /etc/nixos):
sudo nixos-rebuild switch --flake .#vm
From the host, once vm is an ssh alias (builds locally, copies the
closure over):
nixos-rebuild --flake .#vm --target-host vm --build-host localhost
Run nix flake check before committing; it evaluates the config.
Note that flake check does not force specialisations; when you touch a
specialisation, force-eval it, e.g.
nix eval .#nixosConfigurations.vm.config.specialisation.lts-kernel.configuration.system.build.toplevel.drvPath.
Adding a host
Create hosts/<name>/default.nix with the same shape as
hosts/vm/default.nix:
- hostname,
system.stateVersion,nixpkgs.hostPlatform - kernel choice, plus a specialisation if you want an alternate kernel
- toggles:
custom.ssh.enable,custom.desktop.enable,custom.vm.enable - networking: enable what the host needs per host, e.g.
networking.networkmanager.enable = true;(seehosts/vm) custom.btrfs.enablewithluksUuid,espUuid,swapSize(MiB) if the disk matches the shared LUKS+btrfs layout; divergent hardware (multiple drives, unusual ESP) keeps its own hardware-configuration and skipscustom.btrfshome-manager.users.niyariimports
Then add a nixosConfigurations.<name> entry pointing at it in
flake.nix.