-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/nixos: implement session variables #16
base: main
Are you sure you want to change the base?
Conversation
419a4b9
to
f9a2fc1
Compare
3186453
to
800cf2a
Compare
I have additionally added a no systemd version, under this branch. This is a simpler implementation that just creates I have also tested this with zsh and fish, and it seemed to set the variables just fine. |
Given this is an addition to the NixOS module, and that NixOS does in fact use systemd. It feels like a safer bet to expect |
The envvar shadowing is unfortunate, but I can't think of a better solution at this time for that. |
It definitely is, I'm not sure how else we could do it. So far this seems to be the only solution if we do want to use |
800cf2a
to
2894e0d
Compare
The |
2894e0d
to
2045bcf
Compare
@eclairevoyant This should be done. What do you think? Not too sure about the type handling in |
2045bcf
to
f8b3fb8
Compare
This commit adds the module I made for hjem (feel-co/hjem#16). Needs to be removed after it gets merged.
This commit adds the module I made for hjem (feel-co/hjem#16). Needs to be removed after it gets merged.
f8b3fb8
to
5dbca2d
Compare
5dbca2d
to
ee96255
Compare
ee96255
to
9704dad
Compare
9704dad
to
d943655
Compare
The suggestion @NotAShelf mentioned (making sure the file is sourced only once per interactive non-login child shells) has been implemented. Let me know if there is anything that doesn't look right |
This pull request adds handling of NixOS session variables through
environment.d
. However, I had questions about a few design decisions that I made:One of the shortcomings of NixOS when it comes to managing environment variables with
environment.d
is that if said variable is already defined inenvironment.variables
, the user variables defined will not take precedence over the NixOS option. One of the solutions I've found was to explicitely unset it inenvironment.extraInit
, but the issue with that is that it unsets it for the entire system, which is a no-go for a home management solution. I did add aforceOverride
option inenvironment.nix
as draft, but I'd like to get input on that.Is
systemd
ultimately even what we want to manage session variables? I found it extremely convenient, but it makes for a. a solution tied tosystemd
in general, which is probably fine for NixOS since it heavily depends onsystemd
and b. not portable to other systems.I'd also like to gather input on the code, ie. if I misplaced some options that should go into
common.nix
.