I have some session variables set with home.sessionsVariables = { ... }; (with home manager).
They are supposed to be exported in ~/.nix-profile/etc/profile.d/hm-session-vars.sh, which is in turn sourced by .profile, which is supposed to be sourced upon login, and then the environment should be inherited by every terminal. However, when I run echo $EDITOR in a terminal, I don’t see the value I have put but a default one.
This is very strange, as I have two computers that have the exact same nix configuration, but this problem occurs only on one of them…
let me guess: one of your mostly-identical computers is running a Wayland Gnome session, and the other is running an XOrg one?
there is a bit of code in gnome-session that takes care of sourcing .profile, but only under Wayland. I think the underlying assumption there is that some other script takes care of that under XOrg, but for whatever reason this does not hold for NixOS.
I guess just make sure you use Wayland everywhere, if that works for you?
Bingo, this is a difference between my computers! However, using wayland is not an option as the computer that runs XOrg does run wayland for driver-compatibility reasons (aah, Nvidia…).