diff --git a/doc/manual/installation/prerequisites-source.xml b/doc/manual/installation/prerequisites-source.xml index e7bdcf966..fa6da9b1e 100644 --- a/doc/manual/installation/prerequisites-source.xml +++ b/doc/manual/installation/prerequisites-source.xml @@ -8,6 +8,14 @@ + GNU Autoconf + () + and the autoconf-archive macro collection + (). + These are only needed to run the bootstrap script, and are not necessary + if your source distribution came with a pre-built + ./configure script. + GNU Make. Bash Shell. The ./configure script diff --git a/scripts/install-systemd-multi-user.sh b/scripts/install-systemd-multi-user.sh index bef3ac4f9..e0201d53b 100755 --- a/scripts/install-systemd-multi-user.sh +++ b/scripts/install-systemd-multi-user.sh @@ -88,7 +88,7 @@ poly_configure_nix_daemon_service() { systemctl start nix-daemon.socket _sudo "to start the nix-daemon.service" \ - systemctl start nix-daemon.service + systemctl restart nix-daemon.service } diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index d22767967..07c58de92 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -97,7 +97,11 @@ static void _main(int argc, char * * argv) std::string outLink = "./result"; // List of environment variables kept for --pure - std::set keepVars{"HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL", "SHLVL"}; + std::set keepVars{ + "HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", + "IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL", "SHLVL", + "http_proxy", "https_proxy", "ftp_proxy", "all_proxy", "no_proxy" + }; Strings args; for (int i = 1; i < argc; ++i) @@ -423,13 +427,18 @@ static void _main(int argc, char * * argv) lose the current $PATH directories. */ auto rcfile = (Path) tmpDir + "/rc"; writeFile(rcfile, fmt( - (keepTmp ? "" : "rm -rf '%1%'; "s) + + R"(_nix_shell_clean_tmpdir() { rm -rf %1%; }; )"s + + (keepTmp ? + "trap _nix_shell_clean_tmpdir EXIT; " + "exitHooks+=(_nix_shell_clean_tmpdir); " + "failureHooks+=(_nix_shell_clean_tmpdir); ": + "_nix_shell_clean_tmpdir; ") + (pure ? "" : "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;") + "%2%" "dontAddDisableDepTrack=1; " "[ -e $stdenv/setup ] && source $stdenv/setup; " "%3%" - "PATH=\"%4%:$PATH\"; " + "PATH=%4%:\"$PATH\"; " "SHELL=%5%; " "set +e; " R"s([ -n "$PS1" ] && PS1='\n\[\033[1;32m\][nix-shell:\w]\$\[\033[0m\] '; )s" @@ -438,12 +447,12 @@ static void _main(int argc, char * * argv) "shopt -u nullglob; " "unset TZ; %6%" "%7%", - (Path) tmpDir, + shellEscape(tmpDir), (pure ? "" : "p=$PATH; "), (pure ? "" : "PATH=$PATH:$p; unset p; "), - dirOf(*shell), - *shell, - (getenv("TZ") ? (string("export TZ='") + getenv("TZ") + "'; ") : ""), + shellEscape(dirOf(*shell)), + shellEscape(*shell), + (getenv("TZ") ? (string("export TZ=") + shellEscape(getenv("TZ")) + "; ") : ""), envCommand)); Strings envStrs;