mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 05:13:10 +01:00
dns: autogenerate the serial with some funky nix magic
This commit is contained in:
parent
d14f499783
commit
a1afdcbdd0
|
@ -1,12 +1,13 @@
|
|||
{ pkgs, lib, config, dns, ... }:
|
||||
{ self, pkgs, lib, config, dns, ... }:
|
||||
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" {
|
||||
TTL = 3600;
|
||||
SOA = {
|
||||
nameServer = "ns.rfive.de.";
|
||||
adminEmail = "hostmaster@rfive.de";
|
||||
serial = 2024041709;
|
||||
serial = lib.strings.toInt (builtins.substring 0 8 self.sourceInfo.lastModifiedDate + toString ((modulo self.sourceInfo.lastModified 86400) / 864));
|
||||
refresh = 10800;
|
||||
retry = 3600;
|
||||
expire = 604800;
|
||||
|
|
Loading…
Reference in a new issue