services: use doas if enabled

- Remove sudo from recurring-donations path because it's not used by
  the service

- Use doas instead of sudo in secure-node.nix
This commit is contained in:
nixbitcoin
2021-01-30 23:08:43 +01:00
parent ce2b445777
commit 2ca92a34a5
7 changed files with 31 additions and 12 deletions

View File

@@ -57,6 +57,14 @@ with lib;
"$@"
'';
};
# A helper for using doas instead of sudo when doas is enabled
runAsUserCmd = mkOption {
readOnly = true;
default = if config.security.doas.enable
then "doas -u"
else "sudo -u";
};
};
};