Assumptions#
- you have all secrets configured using agenix (sops should work too, but I am not using it ;))
- you want to keep your past configuration
- you already have an existing nixos installation
How-To#
- follow the steps from the NixOS Manual
stop just before the nixos-install command
- NOTE: for the following steps it is assumed that the partitions are mounted on
/mnt
and /mnt/boot
respectively
- copy your agenix identityPaths to the new drive:
for me (default agenix configuration) this could be achieved by:
cp /etc/ssh/ssh_host_* /mnt/etc/ssh
- move your generated
hardware-configuration.nix
to your previous hardware-configuration path
- the rest should stay the same
- (untested) to avoid unneccesary readownloads you might be able to copy over /nix/store
- now run nixos-install
- change the boot order in your BIOS / UEFI settings