Skip to content

Commit c40dfd4

Browse files
committed
ssh: add known hosts
1 parent 21110a5 commit c40dfd4

File tree

7 files changed

+34
-4
lines changed

7 files changed

+34
-4
lines changed

modules/nixos/users/users/eden.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
isNormalUser = true;
1313

1414
openssh.authorizedKeys.keyFiles =
15-
lib.map (file: "${self.secretsDir}/public-keys/${file}")
15+
lib.map (file: "${self.secretsDir}/publicKeys/${file}")
1616
(lib.filter (file: lib.hasPrefix "eden_" file)
17-
(builtins.attrNames (builtins.readDir "${self.secretsDir}/public-keys")));
17+
(builtins.attrNames (builtins.readDir "${self.secretsDir}/publicKeys")));
1818

1919
uid = 1000;
2020
};

modules/snippets/ssh/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{self, ...}: {
2+
imports = self.lib.fs.scanPaths ./.;
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
config,
3+
lib,
4+
self,
5+
...
6+
}: {
7+
options.my.snippets.ssh.knownHosts = lib.mkOption {
8+
type = lib.types.attrs;
9+
description = "Default ssh known hosts.";
10+
11+
default = {
12+
wrath = {
13+
hostNames = ["wrath" "wrath.local" "wrath.${config.my.snippets.tailnet.name}"];
14+
publicKeyFile = "${self.secretsDir}/publicKeys/root_wrath.pub";
15+
};
16+
};
17+
};
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{lib, ...}: {
2+
options.my.snippets.tailnet = {
3+
name = lib.mkOption {
4+
default = "cerberus-tilapia.ts.net";
5+
description = "Tailnet name.";
6+
type = lib.types.str;
7+
};
8+
};
9+
}

secrets/secrets.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
map (file: builtins.readFile "${path}/${file}")
66
(builtins.filter f (builtins.attrNames (builtins.readDir path)));
77

8-
systems = mkList ./public-keys isRoot;
9-
users = mkList ./public-keys isUser;
8+
systems = mkList ./publicKeys isRoot;
9+
users = mkList ./publicKeys isUser;
1010
keys = systems ++ users;
1111
in {
1212
"tailscale-auth.age".publicKeys = keys;

0 commit comments

Comments
 (0)