Open visualphoenix opened 3 months ago
I could not install a nixos system with nixos-anywhere + disko
unless i gave it empty lists of files to persist (environment.persistence."/persist/system".files&directories = []
). And even afterwards when nixos-rebuilding an installed system i kept getting errors when trying to add /etc/machine-id
or /etc/ssh/keyfiles...
to persistence module. It seems the files need to not exist when the persistence module tries to bind them from /persist
to /
, so i solved the ssh keys by just deleting them before rebuilding, but i could not solve the /etc/machine-id
in that way because it always gets recreated before the impermanence module execution. It would be nice to be able to install or rebuild if the files exist and just get a warning instead of a critical error. At this point im not sure which files are mandatory to persist and which arent, this is something i think the docs could explain better. Ill see how well the system holds up in the coming days.
I encountered an issue when trying to use impermanence to mount SSH host keys in NixOS while provisioning a new host with nixos-anywhere + flakes + disko.
I believe the problem is because the SSH host keys are generated during at boot time. The nixos-anywhere provisioning process fails with the following output:
As a workaround, I tried making the entire /etc/ssh directory persistent. This allows nixos-anywhere to provision the system successfully. However, on the first boot, the sshd_config file from the nix-store is not present in the /etc/ssh persistent directory.
A reproducible MVP is here: https://github.com/visualphoenix/nixos-anywhere-disko-impermanence-mvp
Expected behavior:
Actual behavior:
Please let me know if you need any further information or clarification regarding this issue.