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

fix broken NIX_PATH if paths contain spaces #879

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtt9340
Copy link

@jtt9340 jtt9340 commented Feb 21, 2024

The generated user activation script is broken when NIX_PATH contains paths with spaces in them due to the spaces not being escaped.

The motivation for this fix is that I've set use-xdg-base-directories to true while also customizing the XDG_*_HOME variables to try and follow macOS conventions (i.e. XDG_CONFIG_HOME is ~/Library/Application Support, hence the issue with spaces in the path). I then set one of the paths in nix.nixPath to $HOME/Library/Application Support/nix/defexpr/channels which causes the user activation script for switching to a new generation to break.

Comment on lines +6 to +8
# Similar to lib.escapeShellArg but escapes "s instead of 's, to allow for parameter expansion in shells
escapeDoubleQuote = arg: ''"${replaceStrings ["\""] ["\"\\\"\""] (toString arg)}"'';

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this would be the best place for a utility function like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant