{ flake, config, pkgs, lib, ... }: with lib; let psCfg = config.pub-solar; xdg = config.home-manager.users."${psCfg.user.name}".xdg; getIP4 = with pkgs; writeShellScriptBin "getIP" '' ${curl}/bin/curl -4 https://ipcheck-ds.wieistmeineip.de/callback/ | ${coreutils}/bin/tail -c +2 | ${coreutils}/bin/head -c -1 | ${jq}/bin/jq '.ip' -r ''; getIP6 = with pkgs; writeShellScriptBin "getIP" '' echo "2a02:908:5b1:e3c0:3077:2::" ''; in { imports = [ flake.self.nixosModules.ddclient ]; services.ddclient = { enable = true; protocol = "dyndns1"; domains = [ "pie.b12f.io" "droppie.b12f.io" ]; server = "ddns.hosting.de"; username = "b12f"; usev4 = "cmdv4, cmdv4=${getIP4}/bin/getIP"; usev6 = "cmdv6, cmdv6=${getIP6}/bin/getIP"; verbose = true; passwordFile = "/run/agenix/dyndns.key"; interval = "1min"; }; age.secrets."dyndns.key" = { file = "${flake.self}/secrets/dyndns.key.age"; mode = "400"; owner = "root"; }; }