about summary refs log tree commit diff
path: root/users/grfn/system
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2022-01-17T23·05-0500
committergrfn <grfn@gws.fyi>2022-01-20T14·32+0000
commitd92ffcc751a586f9fe86005294e327547c1eb5df (patch)
treeed6b4860eb0c120577e815586f113f6f19b28cc9 /users/grfn/system
parenta366008053bda6a171709df8f410d21fa9a56e30 (diff)
fix(grfn/mugwump): Update for new ddclient config format r/3645
There's a passwordFile option now!

Change-Id: I7aa21891c3502ceddcb0bb08a83a5a3a8a6bcdc9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5025
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/system')
-rw-r--r--users/grfn/system/system/machines/mugwump.nix18
1 files changed, 2 insertions, 16 deletions
diff --git a/users/grfn/system/system/machines/mugwump.nix b/users/grfn/system/system/machines/mugwump.nix
index 8d673420f9d8..a9f876972539 100644
--- a/users/grfn/system/system/machines/mugwump.nix
+++ b/users/grfn/system/system/machines/mugwump.nix
@@ -71,6 +71,7 @@ with lib;
   in {
     bbbg.file = secret "bbbg";
     cloudflare.file = secret "cloudflare";
+    ddclient-password.file = secret "ddclient-password";
   };
 
   services.depot.auto-deploy = {
@@ -137,25 +138,10 @@ with lib;
     zone = "gws.fyi";
     protocol = "cloudflare";
     username = "root@gws.fyi";
+    passwordFile = "/run/agenix/ddclient-password";
     quiet = true;
   };
 
-  systemd.services.ddclient.serviceConfig = {
-    EnvironmentFile = "/run/agenix/cloudflare";
-    DynamicUser = lib.mkForce false;
-    ExecStart = lib.mkForce (
-      let runtimeDir =
-            config.systemd.services.ddclient.serviceConfig.RuntimeDirectory;
-      in pkgs.writeShellScript "ddclient" ''
-        set -eo pipefail
-
-        ${pkgs.gnused}/bin/sed -i -s s/password=/password=$CLOUDFLARE_API_KEY/ /run/${runtimeDir}/ddclient.conf
-        exec ${pkgs.ddclient}/bin/ddclient \
-          -file /run/${runtimeDir}/ddclient.conf \
-          -login=$CLOUDFLARE_EMAIL \
-      '');
-  };
-
   security.acme.certs."metrics.gws.fyi" = {
     dnsProvider = "cloudflare";
     credentialsFile = "/run/agenix/cloudflare";