♻️ [shared] Refactor system configs
This commit is contained in:
@ -15,13 +15,16 @@ with builtins;
|
||||
name = system.hostName;
|
||||
value =
|
||||
let
|
||||
# TODO rename desktop to homelab
|
||||
hostName = if system.hostName == "homelab" then "admin" else system.hostName;
|
||||
hostName =
|
||||
if (system ? address && system.address ? tailnet) then
|
||||
system.address.tailnet
|
||||
else
|
||||
common.tailnetAddr system.hostName;
|
||||
in
|
||||
{
|
||||
port = 22;
|
||||
user = systemConfig.username;
|
||||
hostname = "${hostName}.dns.${common.domain}";
|
||||
hostname = hostName;
|
||||
};
|
||||
}) systems
|
||||
);
|
||||
|
@ -8,7 +8,6 @@
|
||||
}:
|
||||
with builtins;
|
||||
let
|
||||
domain = "dns.${common.domain}";
|
||||
allSystems = knownSystems ++ systems;
|
||||
in
|
||||
{
|
||||
@ -17,7 +16,12 @@ in
|
||||
name = system.hostName;
|
||||
value = {
|
||||
extraHostNames = [
|
||||
"${system.hostName}.${domain}"
|
||||
(
|
||||
if (system ? address && system.address ? tailnet) then
|
||||
system.address.tailnet
|
||||
else
|
||||
common.tailnetAddr system.hostName
|
||||
)
|
||||
];
|
||||
publicKey = system.ssh.publicKey;
|
||||
};
|
||||
|
@ -14,6 +14,10 @@ rec {
|
||||
};
|
||||
|
||||
domain = "martials.no";
|
||||
tailnetDomain = "dns.${domain}";
|
||||
localIpPrefix = "192.168.10.";
|
||||
localIpAddr = subAddr: "${localIpPrefix}${builtins.toString subAddr}";
|
||||
tailnetAddr = host: "${host}.${tailnetDomain}";
|
||||
|
||||
keymaps = {
|
||||
layout = "gb,no";
|
||||
|
Reference in New Issue
Block a user