-
-
Notifications
You must be signed in to change notification settings - Fork 82
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/nixos/common: add initrd ssh #1383
base: master
Are you sure you want to change the base?
Conversation
modules/nixos/common/security.nix
Outdated
|
||
boot.initrd.network.ssh = { | ||
enable = true; | ||
authorizedKeyFiles = pkgs.lib.filesystem.listFilesRecursive "${toString inputs.self}/users/keys"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use systemd in the initrd, I believe we need to also configure networkd here:
boot.initrd.systemd.network.networks."10-uplink" = config.systemd.network.networks."10-uplink";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that we'll need to set host keys for initrd as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge emergency access for now and I'll do ssh later. #1401
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need to also configure networkd here
Looks like this is configured by default?
}; | ||
|
||
system.activationScripts.initrd-ssh-host-key = '' | ||
[[ -f ${initrd_host_key} ]] || ${config.programs.ssh.package}/bin/ssh-keygen -q -t ed25519 -N "" -f ${initrd_host_key} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will fail on the first deployment, but than work on the second one. So probably fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will fail on the first deployment
Could you explain please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activation phase is run after the boot loader is installed in nixos-rebuild. So on the first deployment this will fail.
No description provided.