2024-09-25 23:08:08 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
namespace,
|
|
|
|
config,
|
|
|
|
host,
|
|
|
|
...
|
2025-01-31 01:10:31 +01:00
|
|
|
}:
|
2024-09-25 23:08:08 +02:00
|
|
|
let
|
2025-01-31 01:10:31 +01:00
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2024-09-25 23:08:08 +02:00
|
|
|
cfg = config.${namespace}.services.duckdns;
|
|
|
|
in {
|
|
|
|
options.${namespace}.services.duckdns = {
|
|
|
|
enable = mkEnableOption "Enable DuckDNS, the dynamic dns service. Will periodically refresh your IP.";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
sops.secrets.duckdns = {
|
|
|
|
sopsFile = lib.snowfall.fs.get-file "secrets/duckdns.service.env";
|
|
|
|
format = "dotenv";
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.duckdns = {
|
|
|
|
image = "lscr.io/linuxserver/duckdns:latest";
|
|
|
|
autoStart = true;
|
|
|
|
hostname = host;
|
|
|
|
environmentFiles = [
|
|
|
|
config.sops.secrets.duckdns.path
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|