-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cannot implicitly copy oddly-named files to nix store #6515
Comments
You can use |
Still a problem. |
I think I'm having the same issue but it's
URL-encoding it still threw an error, just over the |
Just add a |
Thanks! I was able to get it working. I can see the argument for not wanting to apply a lossy sanitizing algorithm by default. Have a great day! |
Describe the bug
Attempting to implicitly copy files to the nix store fails when the file's basename does not conform the the sanity requirements imposed on nix store paths.
Steps To Reproduce
Expected behavior
Nix should sanitize the basename before constructing the store path, such that this operation always succeeds, just with a sanitized store path.
This shouldn't cause a reproducibility problem if implemented, since the behavior only differs in situations where there would have been a fatal error before. It's still fail-or-succeed-correctly.
nix-env --version
outputTried with 2.8.0, still a problem.
Additional context
I found this problem while trying to track down why a friend couldn't place his network manager connection files in
/etc
using theenvironment.etc
options inconfiguration.nix
. It was because the files were named after the SSIDs, and the SSIDs have unfortunate characters in their names. I was able to work around it withbuiltins.toFile
+builtins.readFile
+lib.strings.sanitizeDerivationName
, but this really should "just work".The text was updated successfully, but these errors were encountered: