nixos/modules/server/ddns.nix

44 lines
987 B
Nix
Raw Normal View History

2025-01-01 23:55:34 +04:00
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.void.server.ddns;
in {
options.void.server.ddns = { enable = mkEnableOption false; };
config = mkIf cfg.enable {
services = let
ddns-updater-updated =
pkgs.callPackage ../../packages/ddns-updater.nix { };
in {
2025-01-02 00:00:59 +04:00
2025-01-01 23:55:34 +04:00
ddns-updater = {
enable = true;
package = ddns-updater-updated;
2025-01-02 00:07:35 +04:00
environment = lib.mkForce {
"PEROID" = "5m";
"DATADIR" = "/var/lib/ddns-updater";
};
2025-01-01 23:55:34 +04:00
};
2025-01-02 00:00:59 +04:00
2025-01-01 23:55:34 +04:00
nginx.virtualHosts = {
"ddns.sako.box" = {
locations."/" = { proxyPass = "http://localhost:8000"; };
};
};
};
2025-01-02 00:03:54 +04:00
users.users.ddns-updater = {
group = "ddns-updater";
isSystemUser = true;
};
2025-01-02 00:02:56 +04:00
users.groups.ddns-updater = { };
2025-01-02 00:02:07 +04:00
systemd.services.ddns-updater = {
serviceConfig = {
DynamicUser = lib.mkForce false;
User = "ddns-updater";
Group = "ddns-updater";
};
};
2025-01-01 23:55:34 +04:00
};
}