Skip to content
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

Expand tilde to home directory in NIX_PATH #2170

Closed
wants to merge 1 commit into from

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented May 20, 2018

Given that Nix path expressions can start with a tilde, allow the same for NIX_PATH entries.

This is needed for fixing NixOS/nixpkgs#40165 (or well, my suggestion in NixOS/nixpkgs#40165 (comment) depends on that) so this should be picked to the 2.0.x branch as well.

Given that Nix path expressions can start with a tilde, allow the same
for NIX_PATH entries.
@shlevy
Copy link
Member

shlevy commented May 21, 2018

@grahamc just hit this for paths in nix.conf too, might be nice there.

@shlevy
Copy link
Member

shlevy commented May 21, 2018

@dezgeg Can Nix path expressions actually start with a tilde, or is that just shell expansion?

@dezgeg
Copy link
Contributor Author

dezgeg commented May 21, 2018

Yes they do:

| HPATH { $$ = new ExprPath(getHome() + string{$1 + 1}); }

@dtzWill
Copy link
Member

dtzWill commented Jun 14, 2018

This might not always be clear who's home should be used depending on evaluation. I hit this sometimes when I lazily point src to local repo with tilde and it works until I run with sudo :).

FWIW "~user" syntax is not supported.

@grahamc
Copy link
Member

grahamc commented Jun 14, 2018

I'm concerned about the variability of where it resolves, and the ~user/ not being supported. I wonder if a better approach would be to error (?) on '~/foo` files which don't exist?

@stale
Copy link

stale bot commented Feb 13, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 13, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants