1
0
Fork 0
nixos-config/system/init_ssh.nix
2019-07-26 17:31:26 +02:00

28 lines
532 B
Nix

{ config, pkgs, lib, ... }:
with lib;
{
options = {
m-0.server.initSSHKey = mkOption {
type = types.path;
};
};
config = {
boot.initrd = {
network = {
enable = true;
ssh = {
enable = true;
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
# generate file with
# nix-shell -p dropbear
# dropbearkey -t rsa -f boot_rsa
hostRSAKey = config.m-0.server.initSSHKey;
};
};
postMountCommands = "ip link set eth0 down";
};
};
}