I am building a custom iso for an unattended install of nixos. I would like to copy a directory of files into the iso and then copy it into the newly installed system. The files are encrypted secrets that I would manually decrypt and use to bootstrap a separate flake. It would act like a manual version of the --extra-files
option in nixos-anywhere
.
I have succeeded in adding the directory to the iso:
isoImage.contents = [ { source = ../bootstrap ;
target = "/bootstrap";
} ];
But I don’t know how to copy the directory into the newly installed system.
I have been working with an earlier post by @misuzu and tried adding a cp
command to the shell script in iso.nix
but couldn’t work out how to reference the iso mount path as the source of the copy.
What would be the best way to copy a /bootstrap
directory from the iso to the system during installation? Ideally I would copy it into my user’s home directory.