mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 16:39:07 +01:00
Add external host support
This commit is contained in:
parent
f93908d157
commit
28e704ceff
11 changed files with 31 additions and 21 deletions
|
|
@ -18,7 +18,7 @@ in
|
|||
nodes = lib.mkOption {
|
||||
type = lib.types.anything;
|
||||
default =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.map (host: host.config.custom.networking)
|
||||
|> lib.map (
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ in
|
|||
dnsServers = lib.mkOption {
|
||||
type = lib.types.anything;
|
||||
default =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.filter (host: host.config.custom.services.dns.enable)
|
||||
|> lib.map (host: host.config.custom.networking.overlay.address);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ in
|
|||
netCfg.nodes
|
||||
|> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\"");
|
||||
serviceRecords =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.concatMap (
|
||||
host:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ in
|
|||
};
|
||||
|
||||
users.users.seb.openssh.authorizedKeys.keyFiles =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.filter (host: host.config.networking.hostName != netCfg.hostName)
|
||||
|> lib.filter (host: host.config |> lib.hasAttr "home-manager")
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ in
|
|||
settings =
|
||||
let
|
||||
hosts =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.filterAttrs (_: host: host.config.networking.hostName != config.networking.hostName)
|
||||
|> lib.filterAttrs (_: host: host.config.custom.services.syncthing.enable);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ in
|
|||
web-services.gatus.endpoints =
|
||||
let
|
||||
defaultEndpoints =
|
||||
self.nixosConfigurations
|
||||
self.allHosts
|
||||
|> lib.mapAttrs (
|
||||
_: host:
|
||||
host.config.custom.services.caddy.virtualHosts |> lib.attrValues |> lib.map (vHost: vHost.domain)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue