This commit is contained in:
nora 2024-07-31 20:47:34 +02:00
parent 8d0c65448a
commit 6b192fd994
3 changed files with 7 additions and 4 deletions

View file

@ -32,7 +32,7 @@
file: ${import ./noratrieb.dev.nix { inherit pkgs lib networkingConfig; }} file: ${import ./noratrieb.dev.nix { inherit pkgs lib networkingConfig; }}
- domain: nilstrieb.dev - domain: nilstrieb.dev
storage: /var/lib/knot/zones/ storage: /var/lib/knot/zones/
file: ${import ./nilstrieb.dev.nix { inherit pkgs lib; }} file: ${import ./nilstrieb.dev.nix { inherit pkgs lib networkingConfig; }}
log: log:
- target: syslog - target: syslog
any: info any: info

View file

@ -1,14 +1,17 @@
# https://github.com/nix-community/dns.nix # https://github.com/nix-community/dns.nix
{ pkgs, lib, ... }: { pkgs, lib, networkingConfig, ... }:
let let
data = with pkgs.nix-dns.lib.combinators; data = with pkgs.nix-dns.lib.combinators;
let let
hour1 = 3600; hour1 = 3600;
hostsToDns = builtins.mapAttrs hostsToDns = builtins.mapAttrs
(name: { publicIPv4, publicIPv6 }: (name: { publicIPv4, publicIPv6, ... }:
lib.optionalAttrs (publicIPv4 != null) { A = [ (ttl hour1 (a publicIPv4)) ]; } // lib.optionalAttrs (publicIPv4 != null) { A = [ (ttl hour1 (a publicIPv4)) ]; } //
lib.optionalAttrs (publicIPv6 != null) { AAAA = [ (ttl hour1 (aaaa publicIPv6)) ]; }) lib.optionalAttrs (publicIPv6 != null) { AAAA = [ (ttl hour1 (aaaa publicIPv6)) ]; })
networkingConfig; networkingConfig;
vps2 = {
A = [ "184.174.32.252" ];
};
in in
with hostsToDns; with hostsToDns;
{ {

View file

@ -5,7 +5,7 @@ let
let let
hour1 = 3600; hour1 = 3600;
hostsToDns = builtins.mapAttrs hostsToDns = builtins.mapAttrs
(name: { publicIPv4, publicIPv6 }: (name: { publicIPv4, publicIPv6, ... }:
lib.optionalAttrs (publicIPv4 != null) { A = [ (ttl hour1 (a publicIPv4)) ]; } // lib.optionalAttrs (publicIPv4 != null) { A = [ (ttl hour1 (a publicIPv4)) ]; } //
lib.optionalAttrs (publicIPv6 != null) { AAAA = [ (ttl hour1 (aaaa publicIPv6)) ]; }) lib.optionalAttrs (publicIPv6 != null) { AAAA = [ (ttl hour1 (aaaa publicIPv6)) ]; })
networkingConfig; networkingConfig;