From 042e0689ced04b451e30cee22595800359d43696 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:39:21 +1000 Subject: [PATCH] modules/nixos/common: add initrd ssh --- modules/nixos/common/security.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/nixos/common/security.nix b/modules/nixos/common/security.nix index 809e8343e..863b76c30 100644 --- a/modules/nixos/common/security.nix +++ b/modules/nixos/common/security.nix @@ -1,3 +1,4 @@ +{ inputs, pkgs, ... }: { # Make sure that the firewall is enabled, even if it's the default. networking.firewall.enable = true; @@ -5,6 +6,11 @@ # allow to access emergency shell with a password boot.initrd.systemd.emergencyAccess = "$6$he2fblfl/H7I.kvz$WbSCMXu8ztmqfj5jG4czqvu/rkMHxufxqHgy1urzXFSN.jZB4QiW5lOjR08vk8pZTyim3TT1wFkMaNE9zZ3sc1"; + boot.initrd.network.ssh = { + enable = true; + authorizedKeyFiles = pkgs.lib.filesystem.listFilesRecursive "${toString inputs.self}/users/keys"; + }; + services.openssh = { hostKeys = [ {