nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.1k stars 1.83k forks source link

Allow `envVar` Type In `home.sessionVariables` #6043

Open mcmah309 opened 1 week ago

mcmah309 commented 1 week ago

Description

Currently home.sessionVariables does not support the envVar type.

https://github.com/NixOS/nixpkgs/blob/ce460c04269874fb2352efe5763af0ddde91c012/lib/types.nix#L469

https://github.com/nix-community/home-manager/blob/8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661/modules/home-environment.nix#L257

It should, to allow merging environment variable paths defined in different modules.

Related to https://discourse.nixos.org/t/how-to-extend-environment-variables-in-modules/55492

nixos-discourse commented 1 week ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-extend-environment-variables-in-modules/55492/15

rhendric commented 1 week ago

What do you have in mind here and how would it work? There's no mechanism for telling the difference between str and envVar values. Do you intend to replace str with envVar?