-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Description
Describe the bug
ExecStart is hard to read and write.
- Cryptic prefixes
- Surprising escaping (ref unescaping: nixos: add functions and documentation for escaping systemd Exec* directives #154113, although perhaps a clean slate is preferable nixos: add functions and documentation for escaping systemd Exec* directives #154113 (comment))
script is only suitable for a subset of use cases. (#135557, maybe other problems?)
- No prefixes
- No substitutions whatsoever
- Only
ExecStart
Expected behavior
- Uphold the rule that a string is a string unless explicitly requested to be modified.
- Use module system
enums instead of cryptic prefixes (or perhaps add aboolif a prefix can always be combined etc; haven't fully dissected those) - Manage expectations: these aren't bash statements
It might look like this:
systemd.services.foo = {
execStarts = [ # plural; it's a list
{ mode = "privileged"; # `+` prefix; TODO need to research exactly how prefixes combine
exe = "echoAll";
args = [ "$a" { substitute = "%i"; } ]; # escaped by default. not escaped when in { substitute = x; }
}
]
}Maybe even s/args/argv. More explicit, but also cryptic if you don't know C.
Additional context
man systemd.service (Exec* family of fields)
man systemd.unit (substitutions)
Notify maintainers
@NixOS/systemd
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output hereReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md