From 2415cd8d57a46e809b6c450098b76b1564162746 Mon Sep 17 00:00:00 2001 From: twoneis Date: Thu, 6 Feb 2025 18:20:31 +0100 Subject: [PATCH] optional ssh --- modules/ssh/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix index 1811d16..786a2d7 100644 --- a/modules/ssh/default.nix +++ b/modules/ssh/default.nix @@ -1,7 +1,14 @@ -{ ... }: { +{ lib, config, ... }: let + inherit (lib) mkIf; + inherit (config) conf; +in mkIf conf.ssh.enable { services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5i6DgsV5wbkkEJzFbN624Sz0CKg9LGplfJUjeCpAdE" ]; + + users.users.${conf.username}.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5i6DgsV5wbkkEJzFbN624Sz0CKg9LGplfJUjeCpAdE" + ]; }