summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/nsupdate-data.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-07-28 22:24:15 +0200
committermakefu <github@syntax-fehler.de>2023-07-28 22:24:15 +0200
commit060a8f28fa1fc648bdf66afb31a5d1efac868837 (patch)
tree2b354eacc7897365ee45244fe7a51720e0d0333f /makefu/2configs/nsupdate-data.nix
parentcbfcc890e3b76d942b927809bf981a5fa7289e6a (diff)
makefu: move out to own repo, add vacation-note
Diffstat (limited to 'makefu/2configs/nsupdate-data.nix')
-rw-r--r--makefu/2configs/nsupdate-data.nix58
1 files changed, 0 insertions, 58 deletions
diff --git a/makefu/2configs/nsupdate-data.nix b/makefu/2configs/nsupdate-data.nix
deleted file mode 100644
index 3b6518f6..00000000
--- a/makefu/2configs/nsupdate-data.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-# search also generates ddclient entries for all other logs
-
-with import <stockholm/lib>;
-let
- #primary-itf = "eth0";
- #primary-itf = "wlp2s0";
- primary-itf = config.makefu.server.primary-itf;
- ddclientUser = "ddclient";
- sec = toString <secrets>;
- nsupdate = import "${sec}/nsupdate-data.nix";
- stateDir = "/var/spool/ddclient";
- cfg = "${stateDir}/cfg";
- ddclientPIDFile = "${stateDir}/ddclient.pid";
-
- # TODO: correct cert generation requires a `real` internet ip address
-
- gen-cfg = dict: ''
- ssl=yes
- cache=${stateDir}/ddclient.cache
- pid=${ddclientPIDFile}
- ${concatStringsSep "\n" (mapAttrsToList (user: pass: ''
-
- use=if, if=${primary-itf} protocol=dyndns2, server=ipv4.nsupdate.info, login=${user}, password='${pass}' ${user}
- usev6=if, if=${primary-itf} protocol=dyndns2, server=ipv6.nsupdate.info, login=${user}, password='${pass}' ${user}
- '') dict)}
- '';
-
-in {
- users.users.${ddclientUser} = {
- name = ddclientUser;
- uid = genid ddclientUser;
- description = "ddclient daemon user";
- home = stateDir;
- createHome = true;
- isSystemUser = true;
- group = ddclientUser;
- };
- users.groups.${ddclientUser} = {};
-
- systemd.services = {
- ddclient-nsupdate-elchos = {
- wantedBy = [ "multi-user.target" ];
- after = [ "ip-up.target" ];
- serviceConfig = {
- Type = "forking";
- User = ddclientUser;
- PIDFile = ddclientPIDFile;
- ExecStartPre = pkgs.writeDash "init-nsupdate" ''
- cp -vf ${pkgs.writeText "ddclient-config" (gen-cfg nsupdate)} ${cfg}
- chmod 700 ${cfg}
- '';
- ExecStart = "${pkgs.ddclient}/bin/ddclient -verbose -daemon 1 -noquiet -file ${cfg}";
- };
- };
- };
-}