Nix Installation Guide: Difference between revisions

imported>Symphorien
WSL: the sqlite locking mode patch is also needed on WSL
imported>Symphorien
NFS: use an override to install a patched nix so that the patch is picked when updating
Line 50: Line 50:
Nix is hard to build by hand, but you can still use vanilla nix without concurrent use, so you can install nix with a NFS store as follows:
Nix is hard to build by hand, but you can still use vanilla nix without concurrent use, so you can install nix with a NFS store as follows:
* Install nix with the vanilla binary installer
* Install nix with the vanilla binary installer
* Create a file <code>nfs-nix.nix</code>:
* Create a file <code>~/.config/nixpkgs/config.nix</code> as follows, and place the patch above alongside it.
<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
with import <nixpkgs> {};
{
nix.overrideAttrs (old: {
        packageOverrides = pkgs: {
patches = (old.patch or []) ++ [ ./nfs.patch ];
                nix = pkgs.nix.overrideAttrs (old: {
# if you are in a hurry
                                patches = (old.patches or []) ++ [ ./nfs.patch ];
doInstallCheck = false;
                      });
})
        };
}
</syntaxHighlight>
</syntaxHighlight>
* Run <code>nix-env -if ./nfs-nix.nix</code>
* Run <code>nix-env -iA nixpkgs.nix</code> to compile and install the new, patched nix.
* From then on, you can use nix concurrently without risk of corrupting the sqlite database.
* From then on, you can use nix concurrently without risk of corrupting the sqlite database.