From 811e770cb09d572e1672ca2c5c3f60aa16dedb62 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 13 Mar 2023 20:12:53 +0100 Subject: [PATCH] feat: split initrd-ssh into own selectable file --- hosts/ward/default.nix | 1 + modules/core/ssh.nix | 14 -------------- modules/initrd-ssh.nix | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 modules/initrd-ssh.nix diff --git a/hosts/ward/default.nix b/hosts/ward/default.nix index 6252fec..858d57b 100644 --- a/hosts/ward/default.nix +++ b/hosts/ward/default.nix @@ -10,6 +10,7 @@ ../../modules/core ../../modules/hardware/intel.nix + ../../modules/initrd-ssh.nix ../../modules/efi.nix ../../modules/zfs.nix diff --git a/modules/core/ssh.nix b/modules/core/ssh.nix index 5f38355..68424a9 100644 --- a/modules/core/ssh.nix +++ b/modules/core/ssh.nix @@ -1,18 +1,4 @@ { - config, - name, - ... -}: { - rekey.secrets.initrd_host_ed25519_key.file = ../../hosts/${name}/initrd_host_ed25519_key.age; - - boot.initrd.network.enable = true; - boot.initrd.network.ssh = { - enable = true; - port = 4; - hostKeys = [config.rekey.secrets.initrd_host_ed25519_key.path]; - }; - - services.sshd.enable = true; services.openssh = { enable = true; settings = { diff --git a/modules/initrd-ssh.nix b/modules/initrd-ssh.nix new file mode 100644 index 0000000..e03efe9 --- /dev/null +++ b/modules/initrd-ssh.nix @@ -0,0 +1,14 @@ +{ + config, + name, + ... +}: { + rekey.secrets.initrd_host_ed25519_key.file = ../hosts/${name}/initrd_host_ed25519_key.age; + + boot.initrd.network.enable = true; + boot.initrd.network.ssh = { + enable = true; + port = 4; + hostKeys = [config.rekey.secrets.initrd_host_ed25519_key.path]; + }; +}