refactor: derive host name solely from host directory name

This commit is contained in:
2026-04-30 16:40:45 +02:00
parent ce02cc5538
commit 95ffe7b908
19 changed files with 40 additions and 53 deletions

View File

@@ -1,7 +1,12 @@
{ lib, config, ... }:
{
lib,
config,
...
}:
let
inherit (config.host) username;
adminHosts = (import ../../utils { inherit lib; }).adminHosts ../../hosts;
in
{
options.ssh = {
@@ -19,6 +24,6 @@ in
keyFile = ../../hosts/${hostname}/ssh_user.pub;
in
lib.optionals (builtins.pathExists keyFile) (lib.splitString "\n" (builtins.readFile keyFile))
) config.ssh.authorizedHosts
) ((builtins.filter (h: h != config.host.name) adminHosts) ++ config.ssh.authorizedHosts)
);
}