too lazy to think of a message, so enjoy this pointless text. Good luck future me...

This commit is contained in:
Chris Kruining 2025-09-18 12:00:40 +00:00
parent 087b349926
commit d68a3c2727

View file

@ -90,14 +90,14 @@ in
let let
inherit (builtins) head pathExists readFile; inherit (builtins) head pathExists readFile;
controller = head (lib.attrNames roles.controller.machines or {}); server = head (lib.attrNames (roles.server.machines or { not_found = {}; }));
# Read the controller's ip address # Read the server's ip address
ipAddressPath = "${config.clan.core.settings.directory}/vars/per-machine/${controller}/k3s/ip_v4/value"; ipAddressPath = "${config.clan.core.settings.directory}/vars/per-machine/${server}/k3s/ip_v4/value";
ipAddress = if pathExists ipAddressPath then readFile ipAddressPath else null; ipAddress = if pathExists ipAddressPath then readFile ipAddressPath else null;
# Read the controller's token # Read the server's token
# tokenPath = "${config.clan.core.settings.directory}/vars/per-machine/${controller}/k3s/token"; # tokenPath = "${config.clan.core.settings.directory}/vars/per-machine/${server}/k3s/token";
# token = if pathExists tokenPath then readFile tokenPath else null; # token = if pathExists tokenPath then readFile tokenPath else null;
in in
{ {
@ -118,10 +118,14 @@ in
enable = true; enable = true;
role = "agent"; role = "agent";
tokenFile = config.clan.core.vars.generators.k3s.files.token.path; tokenFile = config.clan.core.vars.generators.k3s.files.token.path;
serverAddr = "https://${ipAddress}:6443"; serverAddr = "https://${server}:6443";
}; };
}; };
}; };
}; };
}; };
perMachine = { config, ... }: {
exports.address = "https://${config.networking.fqdn}:6443";
};
} }