this post was submitted on 27 Jan 2026
8 points (100.0% liked)

Nix / NixOS

2623 readers
16 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I'm trying to get my scripts to have precedence over the home manager stuff.

Do you happen to know how to do that?

(not sure it's relevant, but I'm using home-manager in tumbleweed, not nixos)


edit:

Thanks for the replies - I finally got time to investigate this properly so here's a few notes (hopefully useful for someone somehow).

~/.nix-profile/bin is added (prepended) to the path by the files in /nix/var/nix/profiles/default/etc/profile.d/, sourced every time my shell (fish, but it should be the same for others) starts (rg -L nix/profiles /etc 2> /dev/null for how they are sourced).

The path I set in homemanager (via home.sessionPath, which is added (prepended) to home.sessionSearchVariables.PATH) ends up in .nix-profile/etc/profile.d/hm-session-vars.sh, which is sourced via ~/.profile once per session (I think? certainly not when I start fish or bash). This may be due to how I installed home-manager... I don't recall.

So... the solution is to set the path again in my shell (possibly via programs.fish.shellInitLast - I din't check yet).

you are viewing a single comment's thread
view the rest of the comments
[–] devils_dust@lemmygrad.ml 1 points 2 weeks ago

You could use a shell dotfile (.bashrc for instance) for that.

Home manager even allows you to manage them through it, via https://nix-community.github.io/home-manager/options.xhtml#opt-home.file