summary refs log tree commit diff stats
path: root/system/prefect.nix
diff options
context:
space:
mode:
authorAlan Pearce2023-08-09 17:18:22 +0200
committerAlan Pearce2023-08-09 19:22:26 +0200
commite9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e (patch)
tree936557cdca1df35aa00dc7b1e9418827410b22c7 /system/prefect.nix
parent6da36f9d0a4bd300952bd181db72b7e6a224e92d (diff)
downloadnixfiles-e9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e.tar.lz
nixfiles-e9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e.tar.zst
nixfiles-e9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e.zip
prefect: use systemd-networkd for DHCP
Diffstat (limited to 'system/prefect.nix')
-rw-r--r--system/prefect.nix41
1 files changed, 6 insertions, 35 deletions
diff --git a/system/prefect.nix b/system/prefect.nix
index 0078dca4..ad0fab16 100644
--- a/system/prefect.nix
+++ b/system/prefect.nix
@@ -100,6 +100,12 @@
     serviceConfig.ExecStart = "${pkgs.systemd}/bin/systemd-inhibit --mode block --what sleep --who 'ssh session '%I --why 'session still active' ${pkgs.coreutils}/bin/sleep infinity";
   };
 
+  networking = {
+    useNetworkd = true;
+    interfaces.enp6s0 = {
+      useDHCP = true;
+    };
+  };
   networking.nftables = {
     enable = true;
   };
@@ -118,40 +124,5 @@
     hostName = "prefect";
   };
 
-  services.ddclient = {
-    enable = true;
-    package = (pkgs.ddclient.overrideAttrs
-      (old: {
-        patches = (old.patches or [ ]) ++ [
-          ../patches/ddclient-noipv4.patch
-        ];
-      }));
-    use = "no";
-    protocol = "nsupdate";
-    verbose = true;
-    zone = "alanpearce.eu";
-    server = "pappel.alanpearce.eu";
-    passwordFile = "/etc/secrets/ddns.key";
-    domains = [ "prefect.home.alanpearce.eu" ];
-    extraConfig = ''
-      usev4=disabled
-      usev6=cmdv6
-      cmdv6=${pkgs.writeScript "getipv6" ''
-        #!/bin/sh
-        set -eo pipefail
-        ip --oneline address show dev enp7s0 to 2000::/3 primary \
-          | awk '{ print $4 }' \
-          | cut -d/ -f1
-      ''}
-      ttl=3600
-    '';
-  };
-  systemd.services.ddclient.path = with pkgs;
-    [
-      iproute2
-      coreutils
-      gawk
-    ];
-
   system.stateVersion = "23.05";
 }