Open niklasravnsborg opened 2 months ago
It may not seem pretty, but since this is how the system
module works under the hood, you may as well add your imperative command to one of the options below. It will be executed upon each activation.
Example:
system.extraUserActivation.text = ''
echo "setting user's persistent configuration information for launchd domains..."
launchctl config user path /opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin
'';
Running sudo launchctl config user path "/Users/nik/.nix-profile/bin:/usr/bin:/bin"
gives me a 'sudo launchctl config user path…' terminated by signal SIGBUS (Misaligned address error)
. But I guess this is not a nix problem...
I'm looking for a way to declaratively set the
PATH
environment variable used by my macOS applications. I think currently there is no option for this in nix-darwin.Setting the PATH variable is helpful when GUI apps should use binaries of the nix-store which they can't find by default, because the default PATH variable only includes
/usr/bin:/bin:/usr/sbin:/sbin
.For some context refer to this Stackoverflow answer: https://stackoverflow.com/a/70510488.