nixos/ddclient: don't chown secrets until dynamicuser issue is resolved

revert if https://github.com/NixOS/nixpkgs/pull/154928 or a similar fix gets applied
This commit is contained in:
Jörg Thalheim 2022-01-15 07:19:16 +01:00
parent 2b053bc2c1
commit 63971d1fda

View File

@ -29,9 +29,9 @@ let
configFile = if (cfg.configFile != null) then cfg.configFile else configFile'; configFile = if (cfg.configFile != null) then cfg.configFile else configFile';
preStart = '' preStart = ''
install --owner ddclient -m600 ${configFile} /run/${RuntimeDirectory}/ddclient.conf install ${configFile} /run/${RuntimeDirectory}/ddclient.conf
${lib.optionalString (cfg.configFile == null) (if (cfg.protocol == "nsupdate") then '' ${lib.optionalString (cfg.configFile == null) (if (cfg.protocol == "nsupdate") then ''
install --owner ddclient -m600 ${cfg.passwordFile} /run/${RuntimeDirectory}/ddclient.key install ${cfg.passwordFile} /run/${RuntimeDirectory}/ddclient.key
'' else if (cfg.passwordFile != null) then '' '' else if (cfg.passwordFile != null) then ''
password=$(printf "%q" "$(head -n 1 "${cfg.passwordFile}")") password=$(printf "%q" "$(head -n 1 "${cfg.passwordFile}")")
sed -i "s|^password=$|password=$password|" /run/${RuntimeDirectory}/ddclient.conf sed -i "s|^password=$|password=$password|" /run/${RuntimeDirectory}/ddclient.conf