modules/users: fix services to specify PATH with correct precedence
This commit is contained in:
@@ -118,9 +118,13 @@ let
|
|||||||
generatedUnit = utils.systemdUtils.lib.serviceToUnit serviceName (value // {
|
generatedUnit = utils.systemdUtils.lib.serviceToUnit serviceName (value // {
|
||||||
environment = (value.environment or {}) // {
|
environment = (value.environment or {}) // {
|
||||||
# replicate the default NixOS user PATH (omitting dirs which don't exist)
|
# replicate the default NixOS user PATH (omitting dirs which don't exist)
|
||||||
PATH = lib.removePrefix ":" (
|
# N.B.: user PATH SHOULD be before the service's path.
|
||||||
(value.environment.PATH or "")
|
# this allows to user to override preferences for things like e.g. bemenu (for theming)
|
||||||
+ ":/run/wrappers/bin:/etc/profiles/per-user/${name}/bin:/run/current-system/sw/bin"
|
PATH = lib.removeSuffix ":" (
|
||||||
|
"/run/wrappers/bin:"
|
||||||
|
+ "/etc/profiles/per-user/${name}/bin:"
|
||||||
|
+ "/run/current-system/sw/bin:"
|
||||||
|
+ (value.environment.PATH or "")
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user