-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
no-absolute-path-literals
experimental feature
#8738
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-31-nix-team-meeting-minutes-76/31486/1 |
Strong agree. I've been bit by sketchy code breaking when |
This has the nice side-effect of lessoning the gap between impure and pure eval too. |
Discussed during the Nix maintainers meeting on 2024-01-22. Confirmed to be approved
Don't know yet how to deprecate things (needs something like the Nix language version RFC).
But we can still do a warning on style / lint rather than deprecation grounds.
Idea approved. (Actually, already was!) |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-22-nix-team-meeting-minutes-117/38838/1 |
Absolute paths are useful for properly separating repositories in some cases (static configs might live completely separately from complicated generator code), but fortunately at least replaceable by symlinks. How far is |
In flakes those would come in through the lock file, and/or For the non-flakes scenario, I can see alternatives:
... and that brings us to
My proposal here is about path literals, not path values necessarily, so there would be no such restriction. |
Meh, I do too many Nixpkgs inputs with config via environment variables, so flakes won't pay off for me. Wasn't sure if references to non-Nix files via flake input works either, good if they do.
That's not enough for me — static configs include static configs in languages othen than Nix, most recent example — a colorscheme to feed to a Konsole wrapper script but also usable without any involvement of Nix.
Oh right, I try to avoid use of
Well, my first reflex was to check do I have enough arguments to push for a long-term commitment to keep this setting and not break it later. The workarounds are actually cleaner and pretty good and diverse, so not really.
I kind of try to avoid it, but it's also true that there is no Nix restriction here, I don't expect the set of VCSes I consider good idea for my personal config to intersect with the set of VCSes Nix (not just Nixpkgs fetchers) supports. Thanks for the overview of alternative options, that's indeed a useful checklist! |
Understood. I only included it as it might be the singular exception needed by users who otherwise use a single repo. |
See NixOS#8738 for a more pointed criticism of absolute paths.
See NixOS#8738 for a more pointed criticism of absolute paths.
See NixOS#8738 for a more pointed criticism of absolute paths.
Is your feature request related to a problem? Please describe.
Path values are unfit for use as a "path string" replacement because for example
tries to add
/home
to the store.In my experience, the only appropriate use is for referencing source files and locations within a repository. These path values are all created with relative path literals.
Describe the solution you'd like
Add an experimental feature flag or setting that disables absolute path literals such as
/.
and/home
or/var/lib/foo
.Describe alternatives you've considered
/.
.Additional context
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: