all repos — nixfiles @ e9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e

System and user configuration, managed by nix and home-manager

prefect: use systemd-networkd for DHCP
Alan Pearce alan@alanpearce.eu
Wed, 09 Aug 2023 17:18:22 +0200
commit

e9599b4b53a3f0ecf5c5ede990fbbe297c64cf8e

parent

6da36f9d0a4bd300952bd181db72b7e6a224e92d

1 files changed, 6 insertions(+), 35 deletions(-)

jump to
M system/prefect.nixsystem/prefect.nix
@@ -100,6 +100,12 @@ wantedBy = [ "sshd@.service" ];     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;
   };
@@ -117,41 +123,6 @@ ];   networking = {
     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";
 }