Open aanderse opened 1 year ago
Are these systemctl cat
outputs with --no-pager
set? The >
at the end suggests you should scroll to the right…
Sorry for the lack of --no-pager
, I missed that in my paste. I did validate that PATH
was not correct, though. Not there.
EDIT: I have updated the post to contain the missing information. Thanks @flokli.
It seems systemd do not allow to extend environment variables. So, we should avoid setting path per default in case of a dropin. The default is set here: https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/systemd-lib.nix#L317
we should avoid setting path per default in case of a dropin.
What about the following scenario:
{ config, pkgs, ... }: {
systemd.packages = [ pkgs.foo ]; # provides upstream foo.service
systemd.services."foo@bar" = {
overrideStrategy = "asDropin";
# anything else you want here
};
}
In this scenario the foo@bar
service won't have access to coreutils
in its PATH
which may or may not be an issue.
Maybe it is assumed that upstream templated units already have everything they need? Is this acceptable to everyone as long as release notes are added to document this (potentially breaking) change?
Anything I'm missing?
🤔
Describe the bug
A clear and concise description of what the bug is.
Steps To Reproduce
Consider the following NixOS configuration:
And the following invocations:
Expected behavior
A clear and concise description of what you expected to happen.
I wasn't expecting
PATH
to get completely clobbered as seen here:NOTE THAT
PATH
DOESN'T CONTAINhello
AT ALLScreenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The above is a simplified example. I found this out when integrating with
systemd
timers like so:Note that
foo@baz
will fail because$PATH
was clobbered.Notify maintainers
@NixOS/systemd @ck3d
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.