You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to link my fcitx config out-of-nix-store. I've searched the issues and it looks to me that for flake-based setup, I need to pass a string to mkOutOfStoreSymlink:
# omitted full name for brevityxdg.configFile."bla".source=mkOutOfStoreSymlink"/home/me/bla";
I then want to make this more portable by doing this:
# say my project root is at /home/mexdg.configFile."bla".source=mkOutOfStoreSymlink(builtins.toString./bla);
Now it doesn't work. The link terminates at a nix store location.
This is not possible with Flakes because it uses "pure evaluation"/"restricted evaluation".
Essentially, if builtins.toString ./. returned the absolute path of the a file outside of a nix builder's view, it would be impure and leak building information.
Nix Flakes are pure by nature, which makes it impossible to use the functionality you described.
edit: Flakes are also copied to the Nix store, so the relative directory is always relative to the store.
Is there an existing issue for this?
Issue description
I'm trying to link my
fcitx
config out-of-nix-store. I've searched the issues and it looks to me that forflake
-based setup, I need to pass a string tomkOutOfStoreSymlink
:And it worked like this:
so it's fine. I then want to make this more portable by doing this:
Now it doesn't work. The link terminates at a nix store location.
I've read #589 #2085, and I'm confused on why a literal string works, but
toString
doesn't.For my real setup, see https://github.com/yipengsun/nix-config/blob/d3268ce6c3feb6d2cdf56168333582fa476e5bf9/local/profiles/wm/default.nix#L41-L46
Maintainer CC
No response
System information
The text was updated successfully, but these errors were encountered: