2.1 KiB
2.1 KiB
Yes — but you need NixOS, not just “minimal Nix.” Here’s the pragmatic path based on your flake:
What’s missing right now
- There is no hardware config in the repo. You must generate one on the server and include it.
sops-nixexpects the age key filesecrets/age/keys.txtto exist in your local checkout at build time (it’s ignored, so you must place it manually).
Recommended install flow (fresh NixOS install)
- Boot the NixOS minimal ISO on the server and partition/mount as usual.
- Generate hardware config:
nixos-generate-config --root /mnt - Clone this repo into
/mnt/etc/nixos(or/mnt/etc/nixos/bucur). - Move the generated hardware file into the repo:
mv /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/hosts/bucur-hardware.nix - Add it to the flake modules list and ignore it:
- Add
./hosts/bucur-hardware.nixtomodulesinflake.nix. - Add
/hosts/bucur-hardware.nixto.gitignore.
- Add
- Place your age key in the repo (local‑only):
install -d -m 700 /mnt/etc/nixos/secrets/age install -m 600 /path/to/keys.txt /mnt/etc/nixos/secrets/age/keys.txt - Install using the flake:
nixos-install --flake /mnt/etc/nixos#bucur - Reboot, then SSH in as
tobiasusing the key inmodules/users/tobias.nix.
Alternative (remote rebuild on existing NixOS)
- If the server is already running NixOS and you can SSH:
nixos-rebuild switch --flake /path/to/repo#bucur
Important gotchas
services.opensshdisables passwords, so you must have the correct SSH key inmodules/users/tobias.nix.sops-nixwill fail unlesssecrets/age/keys.txtexists in the checkout used to build.server.mdis ignored and no longer part of the repo/history.
If you want, I can:
- Add a
hosts/bucur-hardware.nixplaceholder +.gitignoreentry now. - Give you a copy‑paste install script tailored to your disk layout.
Tell me if the server is fresh or already running NixOS, and how you want to deploy (local install vs remote rebuild).