Put your commands in systemd.services.pdnsd.preStart, like the original module did. It has a type that will merge by concatenating strings with a newline in between.
Oh no, I had temporarily set enable = false; because after a deeper update it effected starting of other services, and forgotten to set it to true again. That in fact results in (only) the ExecStart line missing apparently.
Interesting detail:
with preStart a wrapper is generated for pre-start, which only has my lines (and not the original code) in it.
If I go back to ...ExecStartPre = lib.mkBefore [ ... ] it now gives me the correct script…
I suppose one could experiment whether preStart supports mkBefore etc., but since I like the list format better I went with that.
also everytime I run some pdnsutil command it returns: pdnsutil list-all-zones Warning: unable to read configuration file '/nix/store/rxpwx1n3b6xmb7236k0wkxwqxvizdjz6-pdns-4.7.2/etc/pdns.conf': No such file or directory Error: No database backends configured for launch, unable to function
The problem is that, the config file is not in this path (check the image above, it’s a different nix/store path).
I’m not sure, but I think include-dir is supposed to only contain a /path/to/pdns.d/ in which simply all files with .conf extension are included.
Since I am using nix-sops and couldn’t get files in my /run/secrets/... that have an extension since I cannot have literal dots in my yaml keys, I settled for the following construct:
If I remember correctly the stable version was kind of ancient(?), so I had to overlay it with unstable to get the functionality I needed (I think it was the secretFile support, which reads the env and uses envsubst on the file from extraConfig during service start).
Oh, yes, this variable on include-dir points to "/etc/powerdns/pdns.d"
I already have inside of them two files, db.conf and api.conf, both with the psql config, user, and all credentials… it used to work on 4.3 tho. But, maybe could be the best to pass all of them inside of extraConfig… I’ll try that, tks.
Looks like the problem is that, my Drop-in: /nix/store/5h9a6jpgjpwq4viiaq1d4bz81s6dsipy-system-units/pdns.service.d/override.conf in the pdns.service file is not working for some weird reason… it’s the same configuration that I use for 4.3, the same nixos image, same database, the only difference is that powerdns 4.7 has some deprecated variables that I managed to modify, I’ll try to investigate a little bit more.