Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/initrd-ssh: fix when using nixos-rebuild build-vm-with-bootloader #299474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions nixos/modules/system/boot/initrd-ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ in
hostKeys = mkOption {
type = types.listOf (types.either types.str types.path);
default = [];
# Copy paths to the nix store to mimic what closureInfo would be doing when nixos-rebuild build-vm-with-bootloader is used.
# Otherwise the store entries no longer match when building the initrd there, as closreInfo copies paths with no derivations available *again* to the nix store.
apply = map (path: if isPath path then
(pkgs.runCommand (baseNameOf path) {} ''
cp ${path} $out
'')
else path);
example = [
"/etc/secrets/initrd/ssh_host_rsa_key"
"/etc/secrets/initrd/ssh_host_ed25519_key"
Expand Down