summaryrefslogtreecommitdiff
path: root/os/kay/modules/dns/ddns.nix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-02-28 22:16:39 +0530
committersinanmohd <sinan@sinanmohd.com>2025-02-28 22:16:39 +0530
commit1a767269445960da0c3bd0c93dccebe7b0dfd8ec (patch)
treee289ffc2a1c477fe9296cb28e2c22319c820ec63 /os/kay/modules/dns/ddns.nix
parentd72a55ac3369912643c38878e9df36968b024327 (diff)
kay/ddns: make ipv4 static
Diffstat (limited to 'os/kay/modules/dns/ddns.nix')
-rw-r--r--os/kay/modules/dns/ddns.nix70
1 files changed, 27 insertions, 43 deletions
diff --git a/os/kay/modules/dns/ddns.nix b/os/kay/modules/dns/ddns.nix
index e6e417a..4a8fe5d 100644
--- a/os/kay/modules/dns/ddns.nix
+++ b/os/kay/modules/dns/ddns.nix
@@ -1,44 +1,28 @@
-{ pkgs, ... }: {
- services.pppd.script = {
- "02-ddns-ipv4" = {
- runtimeInputs = with pkgs; [ coreutils knot-dns ];
- type = "ip-up";
-
- text = ''
- cat <<- EOF | knsupdate
- server 2001:470:ee65::1
- zone sinanmohd.com.
-
- update delete sinanmohd.com. A
- update add sinanmohd.com. 180 A $4
-
- update delete mail.sinanmohd.com. A
- update add mail.sinanmohd.com. 180 A $4
-
- send
- EOF
- '';
- };
-
- "02-ddns-ipv6" = {
- runtimeInputs = with pkgs; [ coreutils knot-dns iproute2 gnugrep ];
- type = "ipv6-up";
-
- text = ''
- while ! ipv6="$(ip -6 addr show dev "$1" scope global | grep -o '[0-9a-f:]*::1')"; do
- sleep 0.2
- done
-
- cat <<- EOF | knsupdate
- server 2001:470:ee65::1
- zone sinanmohd.com.
-
- update delete sinanmohd.com. AAAA
- update add sinanmohd.com. 180 AAAA $ipv6
-
- send
- EOF
- '';
- };
- };
+{ pkgs, ... }:
+{
+ services.pppd.script."02-ddns-ipv6" = {
+ type = "ipv6-up";
+ runtimeInputs = with pkgs; [
+ coreutils
+ knot-dns
+ iproute2
+ gnugrep
+ ];
+
+ text = ''
+ while ! ipv6="$(ip -6 addr show dev "$1" scope global | grep -o '[0-9a-f:]*::1')"; do
+ sleep 0.2
+ done
+
+ cat <<- EOF | knsupdate
+ server 2001:470:ee65::1
+ zone sinanmohd.com.
+
+ update delete sinanmohd.com. AAAA
+ update add sinanmohd.com. 180 AAAA $ipv6
+
+ send
+ EOF
+ '';
+ };
}