file name change

This commit is contained in:
2026-03-27 19:22:41 -05:00
parent 6eadadb62b
commit 6b7b0b358e

32
modules/core/njalla.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, lib, ... }:
{
# ── Ensure njalla directory and base script exist on every build ──
systemd.tmpfiles.rules = [
"d /var/lib/njalla 0750 root root -"
];
# ── Create base njalla.sh if it doesn't exist yet ────────────
systemd.services.njalla-init = {
description = "Initialize Njal.la DDNS script if missing";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
unitConfig = {
ConditionPathExists = "!/var/lib/njalla/njalla.sh";
};
script = ''
cat > /var/lib/njalla/njalla.sh <<'SCRIPT'
#!/usr/bin/env bash
IP=$(dig @resolver4.opendns.com myip.opendns.com +short -4)
## Add DDNS entries below one curl per line
## Run 'sudo sovran-setup-domains' to configure automatically
SCRIPT
chmod 700 /var/lib/njalla/njalla.sh
'';
};
}