2024-04-07 12:11:57 +02:00
|
|
|
# DDClient is a dynamic dns service
|
2024-04-07 12:45:04 +02:00
|
|
|
{ config, pkgs, ... }:
|
2024-04-07 12:11:57 +02:00
|
|
|
{
|
|
|
|
imports = [ ../../common/optional/services/acme.nix ];
|
|
|
|
|
|
|
|
services.ddclient = {
|
|
|
|
enable = true;
|
|
|
|
interval = "1m";
|
|
|
|
configFile = config.sops.templates."ddclient.conf".path;
|
2024-04-07 12:45:04 +02:00
|
|
|
|
|
|
|
# REASON: latest release doesn't support explicit root-domain annotations for porkbun
|
|
|
|
package = pkgs.ddclient.overrideAttrs (_: {
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "ddclient";
|
|
|
|
repo = "ddclient";
|
|
|
|
rev = "9885d55a3741363ad52d3463cb846d5782efb073";
|
|
|
|
sha256 = "0zyi8h13y18vrlxavx1vva4v0ya5v08bxdxlr3is49in3maz2n37";
|
|
|
|
};
|
|
|
|
});
|
2024-04-07 12:11:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
sops.templates."ddclient.conf".content = ''
|
|
|
|
# General settings
|
2024-04-07 12:25:22 +02:00
|
|
|
cache=/var/lib/ddclient/ddclient.cache # See the nixos module for details
|
2024-04-07 12:11:57 +02:00
|
|
|
foreground=YES
|
|
|
|
|
|
|
|
# Routers
|
|
|
|
use=web, web=checkip.dyndns.com/, web-skip='Current IP Address: '
|
|
|
|
|
|
|
|
# Protocols
|
|
|
|
protocol=porkbun
|
|
|
|
apikey=${config.sops.placeholder.porkbun_api_key}
|
|
|
|
secretapikey=${config.sops.placeholder.porkbun_secret_api_key}
|
2024-04-07 12:37:00 +02:00
|
|
|
root-domain=moonythm.dev # The root domain detection doesn't work properly
|
2024-04-07 12:11:57 +02:00
|
|
|
real.lapetus.moonythm.dev
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|