Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix multi-user installation with a symlinked store #4022
Installing Nix with a symlinked store is not recommended, but is nevertheless
However, even when setting
This is because sudo does not preserve environment variables and so the environment variable
This change makes sudo preserve the relevant environment variable in order to make installation
Installing Nix with a symlinked store is not recommended, but is nevertheless supported according to the documentation. However, even when setting `NIX_IGNORE_SYMLINK_STORE=1`, installation still fails with the following error: ``` I am executing: $ sudo /nix/store/aizhr07dljmlbf17wfrj40x3s0b5iv3d-nix-2.3.4/bin/nix-store --load-db to load data for the first time in to the Nix Database error: the path '/nix' is a symlink; this is not allowed for the Nix store and its parent directories ``` This is because sudo does not preserve environment variables and so the environment variable `NIX_IGNORE_SYMLINK_STORE` will always be undefined when evaluated by `nix-store`. This change makes sudo preserve the relevant environment variable in order to make installation work again.
Thank you for the review. However, although this does allow the installation to succeed, I've run into several issues allover the place where things failed because of the missing environment variable.
Given how many other things are broken and the brittleness of trying to pipe through the environment variable everywhere, I now prefer to close this in favor of implementing #2926.