From 49c79ce9510550f4a887b069534b826087148276 Mon Sep 17 00:00:00 2001 From: pazpi Date: Fri, 30 Aug 2024 07:55:26 +0200 Subject: [PATCH] Use ssh-keys.nix for key managment --- modules/utils/server-node-users.nix | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/modules/utils/server-node-users.nix b/modules/utils/server-node-users.nix index d4b0f7e..46956c8 100644 --- a/modules/utils/server-node-users.nix +++ b/modules/utils/server-node-users.nix @@ -7,22 +7,7 @@ let cfg = config.my.utils.serverNodeUsers; gitlabUsername = "pazpi"; - sshKeys = - let - localKeys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef" - # Add more local keys as needed - ]; - gitlabKeys = pkgs.lib.splitString "\n" ( - builtins.readFile ( - pkgs.fetchurl { - url = "https://gitlab.com/${gitlabUsername}.keys"; - sha256 = "tHC4DBRO8mXBLFBqGiZlgyY5Pzpl4AMeURCni6H7IjI="; - } - ) - ); - in - localKeys ++ gitlabKeys; + sshKeys = import ../../ssh-keys.nix; in { options.my.utils.serverNodeUsers = { @@ -41,7 +26,7 @@ in users.root = { hashedPassword = "!"; - openssh.authorizedKeys.keys = sshKeys; + openssh.authorizedKeys.keys = sshKeys.infra-core; }; users.pazpi = { @@ -49,7 +34,7 @@ in hashedPassword = "$y$j9T$oWLCV1hnGPyOGabMfAS3p1$/iwouRZGwQXcv6IHnLuT3I9.pmeXNpcHxq.b8xfitr1"; shell = pkgs.bash; extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keys = sshKeys; + openssh.authorizedKeys.keys = sshKeys.infra-core; }; };