Hi!
Now, the word on the street is that you guys are helpful and amazing. Well well, let’s see about that.
TLDR;
- I’m using nixos + zsh, and I want to expand my empire to also include pure-prompt for my prompt.
-
/nix/store
has the wrong permissions according tocompaudit
, it’s simply insecure. Because reasons.
/usr/local/share/zsh/site-functions
has the right permissions. - How to add files to the right directory through my nixos config?
TSWR (Too short, will read);
The manual installation looks simple. Simply download two files and add the path to the $fpath variable.
“No problem!”, I thought, “Here, hold my beer” I said. To myself.
"I’ll just download the files and do something like this in my programs.zsh.interactiveShellInit
" I said with a confident laugh:
# ${./functions}) is a nix expression that evaluates to something like:
# _/nix/store/yrcgg8fd6lcr4y1kmlki4qkza80p0354-functions_
fpath=(${./functions}) $fpath)
# ^ very hard to say laughing confidently IRL
Cool! It works, I’m such a hacker! But, alas, there’s an annoying problem. I keep getting:
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?
And this tells me that the problem is that the nix store isn’t safe in the eyes of zsh:
$ compaudit
# Outputs:
# There are insecure directories:
# /nix/store
When looking at the already existing fpath
variable, I can see this for example /usr/local/share/zsh/site-functions
.
I think it is defined here somehow, with environment.pathsToLink
.
So, how do I add files to /usr/local/share/zsh/site-functions
through my nixos configuration?
OR, how do I define a new directory to be linked? How can nix
know which directory I want (environment.pathsToLink
only accepts strings, not paths)?