PATH env var: Difference between revisions

From NixOS Wiki
Jdorel (talk | contribs)
Created page with "== PATH == === NIxOS Folders === NixOS bin folders are added to the PATH through PAM in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-environment.nix === Adding folders for all users === For systemd to include this PATH, you must include it in one of the following places. In `/etc/environment.d` :<syntaxhighlight lang="nix"> environment.etc."environment.d/00-custom-path.conf".text = '' PATH="${PATH}:<path-to-new-folder>" ''; </syntax..."
 
Jdorel (talk | contribs)
m Add sources
 
Line 19: Line 19:
=== Adding folders for a specific user ===
=== Adding folders for a specific user ===
In `$HOME/.config/environment.d/*.conf`
In `$HOME/.config/environment.d/*.conf`
=== Sources ===
* https://superuser.com/a/1649689
* https://wiki.archlinux.org/title/Systemd/User#Environment_variables

Latest revision as of 11:02, 7 November 2024

PATH

NIxOS Folders

NixOS bin folders are added to the PATH through PAM in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-environment.nix

Adding folders for all users

For systemd to include this PATH, you must include it in one of the following places.

In `/etc/environment.d` :

  environment.etc."environment.d/00-custom-path.conf".text = ''
    PATH="${PATH}:<path-to-new-folder>"
  '';

Or in `/etc/systemd/user.conf` :

systemd.user.extraConfig = ''
  DefaultEnvironment="PATH=<custom-path>"
'';

Adding folders for a specific user

In `$HOME/.config/environment.d/*.conf`

Sources