Symlink Function #843
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#843
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
home managers mkOutOfStoreSymlink seems to be a really popular use case, however it seems a bit odd that its only available through home manager. It would be nice to have dedicated support for custom symlinks in base lix
Describe the solution you'd like
Exactly how this is implemented will likely wind up requiring expertise and perspective I dont have but the basic interface I would suggest is something like symlink src dst that takes a file and symlinks it to the destination. As an additional bonus it would be nice if it checked for pre existing non symlinked files and automatically moved them to FILE.bak or something like that so that its non destructive.
Im not sure if this is the type of thing that falls under lix's perview but I think it would be a huge help
379c9fb858/modules/files.nix (L81)
here is how hm implements it
@maxisthespy the home-manager option creates a trivial builder that runs
ln -s
. Lix limits builtin builders almost as much as possible (in fact they're not even documented, #864).We do have builtin functions for file manipulation at evaluation-time, like
builtins.toFile
, but we don't even have a functions for creating directories, removing files, or renaming files, and these aren't the same kinds of things that home-manager is doing.This sounds like an issue for Nixpkgs to me.
To clarify why we in particular are very very unlikely to add more builtin derivation builders, they present a huge versioning problem as there's no way to know which lix or cppnix that the derivation might wind up getting built on at evaluation time, so they are absolutely impossible to feature detect.
This level of interface stability problem is not something we are comfortable introducing without a good reason, and these derivations do already exist in nixpkgs.
And indeed, a symlink function does need to be a built-in builder, not a function, because I believe there's some technical limitations that mean that functions run on the client like builtins.toFile aren't allowed to produce dependencies on derivations. If you try putting ${hello} into the content of builtins.toFile, it will fail.
In any case, for interface stability reasons, I think this is very unlikely to happen as there are viable alternatives.
I think we are going to file this as WONTFIX, but we are aware that there's use cases for better creation of directory trees from nix language. See the description of #902.