refactor: simplify repo paths
check / lint (push) Successful in 14s

This commit is contained in:
2026-10-11 17:45:55 +02:00
parent 7f5d7914c4
commit 14f8c83cf3
8 changed files with 33 additions and 26 deletions
+4 -4
View File
@@ -2,19 +2,19 @@
lib,
config,
outputs,
paths,
...
}:
let
hosts = lib.attrNames outputs.nixosConfigurations;
hostsWithKeys = lib.filter (
hostname: builtins.pathExists ../../hosts/${hostname}/ssh_host.pub
) hosts;
keyPath = hostname: paths.hosts + "/${hostname}/ssh_host.pub";
hostsWithKeys = lib.filter (hostname: builtins.pathExists (keyPath hostname)) hosts;
in
{
config = lib.mkIf config.ssh.enable {
programs.ssh.knownHosts = lib.genAttrs hostsWithKeys (hostname: {
publicKeyFile = ../../hosts/${hostname}/ssh_host.pub;
publicKeyFile = keyPath hostname;
extraHostNames = lib.optional (hostname == config.networking.hostName) "localhost";
});
};