mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-01-18 17:11:39 +01:00
DNS: autogenerate CNAMES from nginx config
This commit is contained in:
parent
ee02192290
commit
43a4843551
1 changed files with 4 additions and 3 deletions
|
@ -2,7 +2,8 @@
|
|||
let
|
||||
modulo = number: mod: (number - ((number / mod) * mod));
|
||||
secondary = "185.181.104.96";
|
||||
zonefile = with dns.lib.combinators; pkgs.writeText "rfive.de.zone.txt" (dns.lib.toString "rfive.de" {
|
||||
domain = config.networking.domain;
|
||||
zonefile = with dns.lib.combinators; pkgs.writeText "rfive.de.zone.txt" (dns.lib.toString domain {
|
||||
TTL = 3600;
|
||||
SOA = {
|
||||
nameServer = "ns.rfive.de.";
|
||||
|
@ -44,8 +45,8 @@ let
|
|||
_domainkey.subdomains.rspamd.TXT = [ "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDoirUMubro4nlmY6a8JMwK9QB2agAXiJzexDU/7ba6KCggONfoSTfUHlrM/XeM1GG/9oKpngApxDPP97adJuxc8/EELyo4HjTyYD8GBFZhg0AN7V8IPaJ1o5k6dGDk8ZLh41ZCnlAVWkhVSKs5pYtzkrlJIfUSzyuoe8nuFsVe3QIDAQAB" ];
|
||||
|
||||
}
|
||||
(lib.attrsets.genAttrs [ "cache" "chat" "matrix" "seafile" "vault" ] (label: { CNAME = [ "nuc.rfive.de." ]; }))
|
||||
(lib.attrsets.genAttrs [ "purge" "rspamd" "trucks" ] (label: { CNAME = [ "falkenstein.rfive.de." ]; }))
|
||||
(lib.attrsets.genAttrs (map (name: builtins.substring 0 (builtins.stringLength name - (builtins.stringLength domain + 1)) name) (builtins.attrNames self.nixosConfigurations.nuc.config.services.nginx.virtualHosts)) (label: { CNAME = [ "nuc.rfive.de." ]; }))
|
||||
(lib.attrsets.genAttrs (map (name: builtins.substring 0 (builtins.stringLength name - (builtins.stringLength domain + 1)) name) (builtins.attrNames self.nixosConfigurations.falkenstein.config.services.nginx.virtualHosts)) (label: { CNAME = [ "falkenstein.rfive.de." ]; }))
|
||||
];
|
||||
});
|
||||
in
|
||||
|
|
Loading…
Reference in a new issue