move ssh public keys into vars

This commit is contained in:
xunuwu 2025-05-10 09:31:04 +02:00
parent 63fbe20d51
commit 66fc4a96b3
5 changed files with 20 additions and 7 deletions

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDEQgWigEHjD8AGv4Omzm7q3pNk3V0ycvLnsiJkt0TB2 alka@alkpc

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqW5ZkBV2XCdF/ZhwC1DOfrgiLxCC2ym6BO7miHi05M xun@nixdesk

View file

@ -1,6 +1,6 @@
{ {
lib, lib,
self, vars,
... ...
}: { }: {
nix.settings.trusted-users = ["deploy"]; # trust closures created by our user nix.settings.trusted-users = ["deploy"]; # trust closures created by our user
@ -18,9 +18,10 @@
password = lib.mkForce null; password = lib.mkForce null;
passwordFile = lib.mkForce null; passwordFile = lib.mkForce null;
openssh.authorizedKeys.keyFiles = [ openssh.authorizedKeys.keys = with vars.sshKeys; [
(self + /sshKeys/xun_nixdesk) xun_nixdesk
(self + /sshKeys/alka_alkpc) xun_redmi
alka_alkpc
]; ];
}; };
} }

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
vars,
...
}: {
users.users.xun = { users.users.xun = {
isNormalUser = true; isNormalUser = true;
initialPassword = "nixos"; initialPassword = "nixos";
@ -12,5 +16,10 @@
"render" "render"
"audio" "audio"
]; ];
openssh.authorizedKeys.keys = with vars.sshKeys; [
xun_nixdesk
xun_redmi
];
}; };
} }

View file

@ -1,3 +1,8 @@
{ {
domain = "xunuwu.xyz"; domain = "xunuwu.xyz";
sshKeys = {
xun_nixdesk = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqW5ZkBV2XCdF/ZhwC1DOfrgiLxCC2ym6BO7miHi05M xun@nixdesk";
xun_redmi = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2FOrgCLSoewCnDH01SmRqsCb7cR3CA6AcULrlV+180 xun@redmi";
alka_alkpc = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDEQgWigEHjD8AGv4Omzm7q3pNk3V0ycvLnsiJkt0TB2 alka@alkpc";
};
} }