Hacker News new | ask | show | jobs
by dim-an 3167 days ago
Is there a way to install nix into home folder (suppose I don't have sudo on server). I spend some time recently trying to setup nix in such environment and failed. I ended up compiling recent versions of neovim and tmux myself.
3 comments

Yes and no (mostly yes). Ideally, you have /nix/ where everything gets installed, then folders with symlinks in your homedir (one that builds your workspaces and another that versions them) with an environment variable in your bash_rc to hook you in.

You can put that /nix folder anywhere, but you can no longer use their binary package caches and it will recompile everything. This is because they hard-code paths for dependencies during build time.

If you can use it, https://github.com/lethalman/nix-user-chroot is the best way.

But, it depends on user namespaces being enabled on your system. That may not be the case.

Your best bet is proot or a user+mnt namespace.