From 65e7152ef0a2bbedff492814d7ab5b54884f7b68 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Tue, 4 Mar 2025 20:26:05 +0100 Subject: [PATCH] [user module] forgot to set ssh-keys for admin user, use /etc/ssh/hostname as server ssh key --- machines/modules/malobeo/users.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/machines/modules/malobeo/users.nix b/machines/modules/malobeo/users.nix index 543cdd7..4f1b272 100644 --- a/machines/modules/malobeo/users.nix +++ b/machines/modules/malobeo/users.nix @@ -2,6 +2,7 @@ let cfg = config.malobeo.users; sshKeys = import ( inputs.self + /machines/ssh_keys.nix); + inherit (config.networking) hostName; in { options.malobeo.users = { @@ -32,6 +33,7 @@ in isNormalUser = true; description = "admin user, passwordless sudo access, only ssh"; hashedPassword = null; + openssh.authorizedKeys.keys = sshKeys.admins; extraGroups = [ "networkmanager" ]; }; environment.systemPackages = with pkgs; []; @@ -50,6 +52,7 @@ in }) { users.mutableUsers = false; + services.openssh.hostKeys = [{ path = "/etc/ssh/${hostName}"; type = "ssh-ed25519"; }]; environment.systemPackages = with pkgs; [ nix-output-monitor vim