I should commit more frequently
This commit is contained in:
parent
aa8003f5b4
commit
e82241b8b0
70 changed files with 1091 additions and 2018 deletions
24
modules/ssh-initrd/default.nix
Normal file
24
modules/ssh-initrd/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{config, ...}: {
|
||||
# For unlocking the disk connect using ssh and type
|
||||
# systemctl start initrd-nixos-activation
|
||||
boot.initrd = {
|
||||
network = {
|
||||
enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
ignoreEmptyHostKeys = true;
|
||||
extraConfig = ''
|
||||
HostKey /ssh_initrd_host_ed25519_key
|
||||
'';
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
enable = true;
|
||||
storePaths = ["${config.programs.ssh.package}/bin/ssh-keygen"];
|
||||
services.sshd.preStart = ''
|
||||
${config.programs.ssh.package}/bin/ssh-keygen -t ed25519 -N "" -f /ssh_initrd_host_ed25519_key
|
||||
chmod 600 /ssh_initrd_host_ed25519_key
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue