aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-09-28 22:04:45 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-09-28 22:04:45 +0200
commit3e54e64ec074f4bec4051c4e448ba08196dbd3f9 (patch)
tree29331e250cea2a9ff9d1628681b88af4d5584354
parentmodules/mail: Add `soispha@b-peetz.de` as a separate user (diff)
downloadnixos-server-3e54e64ec074f4bec4051c4e448ba08196dbd3f9.zip
zones/*: Deduplicate `mkSerial` functionHEADmain
-rw-r--r--zones/default.nix44
-rw-r--r--zones/j-schoeffel.de/zone.nix36
-rw-r--r--zones/jaki-schoeffel.de/zone.nix36
-rw-r--r--zones/jaki.li/zone.nix36
-rw-r--r--zones/vhack.eu/zone.nix36
5 files changed, 43 insertions, 145 deletions
diff --git a/zones/default.nix b/zones/default.nix
index de03a0d..dc3eb9f 100644
--- a/zones/default.nix
+++ b/zones/default.nix
@@ -1,6 +1,40 @@
-{lib, ...}: {
- "vhack.eu" = import ./vhack.eu/zone.nix {inherit lib;};
- "j-schoeffel.de" = import ./j-schoeffel.de/zone.nix {inherit lib;};
- "jaki-schoeffel.de" = import ./jaki-schoeffel.de/zone.nix {inherit lib;};
- "jaki.li" = import ./jaki.li/zone.nix {inherit lib;};
+{lib, ...}: let
+ /*
+ Computes a reasonable value for the DNS serial number from the date of last change
+ and the iteration of that day.
+
+ # Type
+
+ mkSerial :: Number -> Number -> Number -> Number -> Number
+
+ # Arguments
+
+ year
+ : The year of the last change in the format YYYY.
+
+ month
+ : The month of the last change in the format MM.
+
+ day
+ : The day of the last change in the format DD.
+
+ iteration
+ : The number of change on that day. The format should be CC (assuming there are less
+ than 100 changes happening on a day) .
+
+ # Examples
+
+ mkSerial 2025 04 01 01
+ => 2025040101
+ */
+ mkSerial = year: month: day: iteration: let
+ n2 = lib.strings.fixedWidthNumber 2;
+ n4 = lib.strings.fixedWidthNumber 4;
+ in
+ lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}";
+in {
+ "vhack.eu" = import ./vhack.eu/zone.nix {inherit mkSerial;};
+ "j-schoeffel.de" = import ./j-schoeffel.de/zone.nix {inherit mkSerial;};
+ "jaki-schoeffel.de" = import ./jaki-schoeffel.de/zone.nix {inherit mkSerial;};
+ "jaki.li" = import ./jaki.li/zone.nix {inherit mkSerial;};
}
diff --git a/zones/j-schoeffel.de/zone.nix b/zones/j-schoeffel.de/zone.nix
index a162a92..655f937 100644
--- a/zones/j-schoeffel.de/zone.nix
+++ b/zones/j-schoeffel.de/zone.nix
@@ -1,38 +1,4 @@
-{lib, ...}: let
- /*
- Computes a reasonable value for the DNS serial number from the date of last change
- and the iteration of that day.
-
- # Type
-
- mkSerial :: Number -> Number -> Number -> Number -> Number
-
- # Arguments
-
- year
- : The year of the last change in the format YYYY.
-
- month
- : The month of the last change in the format MM.
-
- day
- : The day of the last change in the format DD.
-
- iteration
- : The number of change on that day. The format should be CC (assuming there are less
- than 100 changes happening on a day) .
-
- # Examples
-
- mkSerial 2025 04 01 01
- => 2025040101
- */
- mkSerial = year: month: day: iteration: let
- n2 = lib.strings.fixedWidthNumber 2;
- n4 = lib.strings.fixedWidthNumber 4;
- in
- lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}";
-in {
+{mkSerial, ...}: {
SOA = {
nameServer = "name-server1.j-schoeffel.de.";
adminEmail = "dns-admin@foss-syndicate.org";
diff --git a/zones/jaki-schoeffel.de/zone.nix b/zones/jaki-schoeffel.de/zone.nix
index d79f2f1..94830e0 100644
--- a/zones/jaki-schoeffel.de/zone.nix
+++ b/zones/jaki-schoeffel.de/zone.nix
@@ -1,38 +1,4 @@
-{lib, ...}: let
- /*
- Computes a reasonable value for the DNS serial number from the date of last change
- and the iteration of that day.
-
- # Type
-
- mkSerial :: Number -> Number -> Number -> Number -> Number
-
- # Arguments
-
- year
- : The year of the last change in the format YYYY.
-
- month
- : The month of the last change in the format MM.
-
- day
- : The day of the last change in the format DD.
-
- iteration
- : The number of change on that day. The format should be CC (assuming there are less
- than 100 changes happening on a day) .
-
- # Examples
-
- mkSerial 2025 04 01 01
- => 2025040101
- */
- mkSerial = year: month: day: iteration: let
- n2 = lib.strings.fixedWidthNumber 2;
- n4 = lib.strings.fixedWidthNumber 4;
- in
- lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}";
-in {
+{mkSerial, ...}: {
SOA = {
nameServer = "name-server1.jaki-schoeffel.de.";
adminEmail = "dns-admin@foss-syndicate.org";
diff --git a/zones/jaki.li/zone.nix b/zones/jaki.li/zone.nix
index 792fce2..3e55907 100644
--- a/zones/jaki.li/zone.nix
+++ b/zones/jaki.li/zone.nix
@@ -1,38 +1,4 @@
-{lib, ...}: let
- /*
- Computes a reasonable value for the DNS serial number from the date of last change
- and the iteration of that day.
-
- # Type
-
- mkSerial :: Number -> Number -> Number -> Number -> Number
-
- # Arguments
-
- year
- : The year of the last change in the format YYYY.
-
- month
- : The month of the last change in the format MM.
-
- day
- : The day of the last change in the format DD.
-
- iteration
- : The number of change on that day. The format should be CC (assuming there are less
- than 100 changes happening on a day) .
-
- # Examples
-
- mkSerial 2025 04 01 01
- => 2025040101
- */
- mkSerial = year: month: day: iteration: let
- n2 = lib.strings.fixedWidthNumber 2;
- n4 = lib.strings.fixedWidthNumber 4;
- in
- lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}";
-in {
+{mkSerial, ...}: {
SOA = {
nameServer = "name-server1.jaki.li.";
adminEmail = "dns-admin@foss-syndicate.org";
diff --git a/zones/vhack.eu/zone.nix b/zones/vhack.eu/zone.nix
index 91b5232..891d95a 100644
--- a/zones/vhack.eu/zone.nix
+++ b/zones/vhack.eu/zone.nix
@@ -1,38 +1,4 @@
-{lib, ...}: let
- /*
- Computes a reasonable value for the DNS serial number from the date of last change
- and the iteration of that day.
-
- # Type
-
- mkSerial :: Number -> Number -> Number -> Number -> Number
-
- # Arguments
-
- year
- : The year of the last change in the format YYYY.
-
- month
- : The month of the last change in the format MM.
-
- day
- : The day of the last change in the format DD.
-
- iteration
- : The number of change on that day. The format should be CC (assuming there are less
- than 100 changes happening on a day) .
-
- # Examples
-
- mkSerial 2025 04 01 01
- => 2025040101
- */
- mkSerial = year: month: day: iteration: let
- n2 = lib.strings.fixedWidthNumber 2;
- n4 = lib.strings.fixedWidthNumber 4;
- in
- lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}";
-in {
+{mkSerial, ...}: {
SOA = {
nameServer = "name-server1.vhack.eu.";
adminEmail = "dns-admin@foss-syndicate.org";