Hi! I’m trying to get started with nix for the first time. I installed nix
on an existing arch linux installation using sudo pacman -S nix
. I’m then following these instructions:
https://wiki.archlinux.org/title/Nix#Installation
and have enabled the daemon, added my user to the nix-users
group, added a channel and updated it.
But the example with nix-env
does not work. Ie nix-env -iA '<nixpkgs>.hello'
gives error: attribute '<nixpkgs>' in selection path '<nixpkgs>.hello' not found
. I suspect this is because I have no NIX_PATH
env variable.
For example if I do nix-instantiate --eval -E '<nixpkgs>'
I get an error again, however (NIX_PATH=/home/axel/.nix-defexpr/channels/stable/nixpkgs nix-instantiate --eval -E '<nixpkgs>')
does work.
I see mentions of sourcing nix.sh
online but I have no such file. Indeed the arch package removes this file:
and the mentioned bug report states that only nix-daemon.sh
should be sourced. But that does not have any NIX_PATH
in it. Where is this supposed to come from?
Not sure this is related but my ~/.nix-profile
is a symlink to a non-existent /home/axel/.local/state/nix/profiles/profile
.
Thanks in advance for any help!