Updating nix-portable from git master

Hi all,

I’m new to the nix world and my question is likely silly. I am setting up nix in an HPC server environment without sudo/root privileges and being able to create /nix/store directory. My host distro is CentOS 7. I was able to install nix-portable and it seems to work. The only issue is that I used the binary package that is rather old (latest one is Release nix-portable-009 · DavHau/nix-portable · GitHub January, 2022) and it includes a very old version of nix (2.5.1). I tried to build nix-portable from git master like so:

$ git clone https://github.com/DavHau/nix-portable.git nix-portable-src
$ cd nix-portable-src
$ nix-portable nix build

This successfully built the nix-portable and placed it inside ~/.nix-portable/store/
However when I tried using that version instead of the downloaded nix-portable binary from the host container like so, I got the error:

$ NP_DEBUG=2 ./nix-portable nix-shell -p nix
error: the path '/nix/store' is a symlink; this is not allowed for the Nix store and its parent directories

This is likely because I built it inside the nix-shell and it expects /nix/store to be a valid path. Perhaps I needed to build it in a different way, but I don’t know how.

Another question may be related or not, but independently of upgrading nix-portable how can I upgrade nix inside nix-portable installation so that ./nix-portable nix defaults to the up to date version?