mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
caddy: Add support for web services over nebula
This commit is contained in:
parent
b7db8d2fd8
commit
116b4437fe
3 changed files with 84 additions and 4 deletions
|
|
@ -1,4 +1,10 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
nebulaCfg = config.custom.services.nebula;
|
||||
cfg = nebulaCfg.node;
|
||||
|
|
@ -25,8 +31,21 @@ in
|
|||
|
||||
local-zone = "\"${nebulaCfg.network.domain}.\" static";
|
||||
local-data =
|
||||
nebulaCfg.nodes
|
||||
|> lib.map (node: "\"${node.name}.${nebulaCfg.network.domain}. A ${node.address}\"");
|
||||
let
|
||||
nodeRecords =
|
||||
nebulaCfg.nodes
|
||||
|> lib.map (node: "\"${node.name}.${nebulaCfg.network.domain}. A ${node.address}\"");
|
||||
serviceRecords =
|
||||
self.nixosConfigurations
|
||||
|> lib.attrValues
|
||||
|> lib.concatMap (
|
||||
host:
|
||||
host.config.meta.domains.local
|
||||
|> lib.filter (domain: lib'.isPrivateDomain domain)
|
||||
|> lib.map (domain: "\"${domain}. A ${host.config.custom.services.nebula.node.address}\"")
|
||||
);
|
||||
in
|
||||
nodeRecords ++ serviceRecords;
|
||||
};
|
||||
|
||||
forward-zone =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue