{
  config,
  lib,
  ...
}: let
  cfg = config.marleyos.services.ddclient;
in {
  options.marleyos.services.ddclient.enable = lib.mkEnableOption "ddclient";

  config = lib.mkIf cfg.enable {
    nixpkgs.overlays = [(import ../../../overlays/ddclient.nix)];

    age.secrets.ddclient.file = ../../../secrets/ddclient.conf.age;

    services.ddclient = {
      enable = true;

      configFile = config.age.secrets.ddclient.path;
    };
  };
}
