diff --git a/etc/bashrc.sh b/etc/bashrc.sh index 66f6c57869e1..a396a7c302d3 100644 --- a/etc/bashrc.sh +++ b/etc/bashrc.sh @@ -6,6 +6,7 @@ if test -n "@nssModulesPath@"; then fi export MODULE_DIR=@modulesTree@/lib/modules export NIXPKGS_CONFIG=/nix/etc/config.nix +export NIXPKGS_ALL=/etc/nixos/nixpkgs export PAGER="less -R" export TZ=@timeZone@ export TZDIR=@glibc@/share/zoneinfo diff --git a/system/system.nix b/system/system.nix index 256eeeeb1dc4..bc83b355ed9c 100644 --- a/system/system.nix +++ b/system/system.nix @@ -168,11 +168,22 @@ rec { # Environment variables for running Nix. nixEnvVars = - "export NIX_CONF_DIR=/nix/etc/nix\n" + + '' + export NIX_CONF_DIR=/nix/etc/nix + + # Enable the copy-from-other-stores substituter, which allows builds + # to be sped up by copying build results from remote Nix stores. To + # do this, mount the remote file system on a subdirectory of + # /var/run/nix/remote-stores. + export NIX_OTHER_STORES=/var/run/nix/remote-stores/*/nix + + '' + # */ (if config.nix.distributedBuilds then - "export NIX_BUILD_HOOK=${nix}/libexec/nix/build-remote.pl\n" + - "export NIX_REMOTE_SYSTEMS=/etc/nix.machines\n" + - "export NIX_CURRENT_LOAD=/var/run/nix/current-load\n" + '' + export NIX_BUILD_HOOK=${nix}/libexec/nix/build-remote.pl + export NIX_REMOTE_SYSTEMS=/etc/nix.machines + export NIX_CURRENT_LOAD=/var/run/nix/current-load + '' else "");