From 0d0346052044f5e9aefbc61dabfc2e37a71a2473 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 19 Dec 2017 14:09:14 +0100 Subject: Dynamic zone set --- ymir.nix | 12 +++++++++--- ymir/zones/index.nix | 14 -------------- 2 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 ymir/zones/index.nix diff --git a/ymir.nix b/ymir.nix index 5f4c4969..6e68e01c 100644 --- a/ymir.nix +++ b/ymir.nix @@ -1,5 +1,7 @@ { config, pkgs, lib, ... }: +with lib; + let luaPam = pkgs.callPackage ./custom/luaPam.nix {}; luaPosix = pkgs.callPackage ./custom/luaPosix.nix {}; @@ -22,6 +24,10 @@ let "ymir.kleen.li" "kleen.li" "www.kleen.li" "ymir.nights.email" "nights.email" "www.nights.email" ]; + + dnsZones = listToAttrs (flatten (mapAttrsToList dnsZone (readDir ./custom/ymir/zones))); + dnsZone = fName: type: optional (type == "regular" || type == "symlink") (nameValuePair (dnsZoneName fName) (readFile (./custom/ymir/zones + fName))) + dnsZoneName = fName: concatStringsSep "." (reverseList (splitString "." (removeSuffix ".soa" fName))) in rec { imports = [ @@ -688,7 +694,7 @@ in rec { enable = true; user = "postfix"; group = "postfix"; socket = "local:/var/lib/postfix/queue/private/dkim"; - domains = ''csl:${pkgs.lib.concatStringsSep "," myDomains}''; + domains = ''csl:${concatStringsSep "," myDomains}''; keyPath = "/var/lib/dkim/"; selector = "ymir"; configFile = builtins.toFile "opendkim.conf" '' @@ -903,7 +909,7 @@ in rec { "185.181.104.96 NOKEY" ]; outgoingInterface = "188.68.51.254"; - children = (import ./ymir/zones/index.nix { inherit (pkgs) lib; }); + children = dnsZones; dnssec = true; dnssecPolicy = { coverage = "2mo"; @@ -1041,6 +1047,6 @@ in rec { ''; users.extraUsers."vsftpd" = { - home = lib.mkForce "/srv/ftp"; + home = mkForce "/srv/ftp"; }; } diff --git a/ymir/zones/index.nix b/ymir/zones/index.nix deleted file mode 100644 index 4453066c..00000000 --- a/ymir/zones/index.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib }: - -with lib; - -rec { - "141.li" = { data = readFile ./li.141.soa; }; - "dirty-haskell.org" = { data = readFile ./org.dirty-haskell.soa; }; - "praseodym.org" = { data = readFile ./org.praseodym.soa; }; - "xmpp.li" = { data = readFile ./li.xmpp.soa; }; - "yggdrasil.li" = { data = readFile ./li.yggdrasil.soa; }; - "kleen.li" = { data = readFile ./li.kleen.soa; }; - "nights.email" = { data = readFile ./email.nights.soa; }; - "rheperire.org" = { data = readFile ./org.rheperire.soa; }; -} -- cgit v1.2.3