-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Currently, env attribute values are interpreted as a static string. That means that it is not possible to include existing environment variables inside a new definition. For example:
make-shells.default.env = {
HOME_DRV = "\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profiles/home-manager";
};Results in:
$ echo $HOME_DRV
${XDG_STATE_HOME:-$HOME/.local/state}/nix/profiles/home-managerThough I would hope for something like this result instead:
$ echo $HOME_DRV
/home/<USER>/.local/state/nix/profiles/home-managerhttps://github.com/numtide/devshell provides a mechanism to handle this, which can be seen in https://github.com/numtide/devshell/blob/main/modules/env.nix and loaded as a setup hook in https://github.com/numtide/devshell/blob/7c9e793ebe66bcba8292989a68c0419b737a22a0/modules/devshell.nix (see the envBash variable). It would be great if make-shell did something similar, but in a simpler way!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels