services: add names for systemd helper scripts

The systemd journal now shows a specific script name instead of
the generic name "script" before script output.
This commit is contained in:
Erik Arvstedt 2021-02-01 22:53:23 +01:00
parent 6982699613
commit 6a32812412
No known key found for this signature in database
GPG key ID: 33312B944DD97846
3 changed files with 25 additions and 24 deletions

View file

@ -52,13 +52,13 @@ let self = {
'';
};
script = src: pkgs.writers.writeBash "script" ''
script = name: src: pkgs.writers.writeBash name ''
set -eo pipefail
${src}
'';
# Used for ExecStart*
privileged = src: "+${self.script src}";
privileged = name: src: "+${self.script name src}";
cliExec = mkOption {
# Used by netns-isolation to execute the cli in the service's private netns