Commit graph

754 commits

Author SHA1 Message Date
Graham Christensen 6b887844d6
replace lolcat with nix-info
(cherry picked from commit 1db034364a)
2017-12-08 07:30:51 -05:00
Graham Christensen c32bdf0548
darwin installer: fix on High Sierra
(cherry picked from commit be79d1f189)
2017-12-08 07:30:44 -05:00
Eelco Dolstra 76431e0a26
nix-shell -p: Use runCommandCC
This restores pre-17.03 behaviour by making gcc available.

(Ported from 9b63bb88c8)
2017-10-13 17:28:04 +02:00
Shea Levy 3c52567b3e
darwin installer: Fix on systems where sudo -i is disabled.
(cherry picked from commit fb98e29067)
2017-10-12 13:08:33 +02:00
Anthony Cowley b03066835c
install-darwin-multi-user: relax assumption check
The installer will error out if a user's shell configuration includes any mention of ~nix-profile~, even if this is in a comment. This change is designed to do the bare minimum to ignore lines beginning with a `#`.

(cherry picked from commit 92f9d18aa0)
2017-10-12 13:06:46 +02:00
Falco Peijnenburg b3ad7c5052 scripts/nix-copy-closure.in: Automatically flush STDERR handle
Fixes https://github.com/NixOS/nixops/issues/455
2017-09-10 17:38:18 +02:00
Graham Christensen d07697de5f
Replace stat / uid comparison with test -O 2017-08-29 18:56:32 -04:00
Domen Kožar 3afb744185 Merge pull request #1313 from neilmayhew/topic/cores
Propagate NIX_BUILD_CORES to nix-shell environments
2017-08-02 15:02:25 +02:00
Graham Christensen 9a04bc6f5e
Test to see if nix-daemon is running already
A user had an install, uninstalled it via the instructions, and found their nix broken.

The issue was based around nix-daemon already running.

I tried to be very smart around searching their launchctl files:

  $ grep -ri nix-daemon  ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons

but then couldn't figure out how to write out (nicely) commands for uninstalling
or unloading them based on their name, and also couching the instrunctions in a
bit of doubt so we don't piss off some poor mac admin because their users just
deleted some important launchd files.
2017-07-24 22:37:22 -04:00
Graham Christensen 4b45f94b5c
Show users how to source the profile, to get a working Nix. 2017-07-17 08:39:14 -04:00
Graham Christensen e4831a4412
Rename PINCH_ME_IM_SILLY to ALLOW_PREEXISTING_INSTALLATION 2017-07-14 06:28:24 -04:00
Graham Christensen 6ba624f25a
If there is no TTY, also skip verbose sudo messages 2017-07-14 06:23:51 -04:00
Graham Christensen 6b6d4b69c1
Ensure PINCH_ME_IM_SILLY allows a /nix/store to stick around between builds
Also output in the status report that the user is very silly
2017-07-13 19:45:00 -04:00
Graham Christensen b01eaa6114
Assume yes if we have no TTY
Starve the TTY of input to ensure this works, but provide yes to the
current installer to handle the current broken case.
2017-07-13 18:03:53 -04:00
Graham Christensen 2442c4684d
Address feedback around printf & exec 2017-07-12 11:45:35 -04:00
Graham Christensen d4f128352e
Don't install a second nix after the initial installation, and the rsync change fixes a bug hidden by the nix replacement where the store files were being owned by the installing user due to rsync's -a implying -og. 2017-07-12 11:45:32 -04:00
Graham Christensen 661daed683
Clean up issues around uninstall directions, and only show
relevant directions
2017-07-12 11:45:25 -04:00
Graham Christensen 262a08c0e2
Prompt for sudo before validating assumptions, and check ourselves for root-owned files instead of making a scary warning. 2017-07-12 11:45:22 -04:00
Graham Christensen 3ebd25a644
multi-user install: move the profile in to the nix etc/profiles.d output 2017-07-12 11:45:19 -04:00
Graham Christensen 218978154a
Switch to a fancy multi-user installer on Darwin 2017-07-12 11:45:13 -04:00
Graham Christensen 799f5adf79
Shellcheck the existing installer 2017-07-12 11:44:28 -04:00
Shea Levy 2a0112a370 Merge branch 'add-nix-profile-daemon' of git://github.com/grahamc/nix into 1.11-maintenance 2017-07-09 16:03:15 -04:00
Graham Christensen 3e0a503bf7
Create a profile suitable for multi-user installs 2017-07-09 14:52:33 -04:00
Joel Rivera 7917494c45 Add support for the curl netrc file in nix-channel/nix-pull.
Based on the implementation in download-from-binary-cache.pl.in.
2017-06-13 18:18:20 -05:00
Neil Mayhew de4e706776 Propagate NIX_BUILD_CORES to nix-shell environments 2017-04-08 21:31:44 -06:00
Shea Levy a437b8c5d2 download-from-binary-cache.pl: Respect netrc-file 2017-03-05 17:40:17 -05:00
Domen Kožar 13fe83dc8e
bail out if macOS 10.9 or lower is used during installer
(cherry picked from commit 48d4a23aa0)
Signed-off-by: Domen Kožar <domen@dev.si>

cc @edolstra
2017-02-23 15:12:35 +01:00
Eelco Dolstra 142c777112
Propagate path of CA bundle to curl child processes 2017-02-22 12:43:13 +01:00
Eelco Dolstra 41230dd463
SSL_CERT_FILE -> NIX_SSL_CERT_FILE
This prevents collisions with the "native" OpenSSL, in particular on
OS X.

Fixes #921.

(cherry picked from commit fb2dd32100)
2017-02-22 12:30:45 +01:00
Tuomas Tynkkynen a4ad1ffa25 nix-shell: Fix 'nix-shell --command' doing nothing without TTY
Regression from 8bddc3d4 ("Fix early removal of rc-file for nix-shell").
The removal of BASH_ENV causes nothing to be executed by bash if it
detects itself in a non-interactive context. Instead, just
use the same condition used by bash to launch bash differently.

According to bash sources, the condition (stdin and stder both
must be TTYs) is specified by POSIX so this should be pretty
safe to rely on.

Fixes #1171 on 1.11.
2017-01-07 19:36:45 +02:00
Shea Levy 8bddc3d406 Fix early removal of rc-file for nix-shell
BASH_ENV causes all non-interactive shells called via eg. /etc/bashrc to
remove the rc-file before the main shell gets to run it. Completion
scripts will often do this. Fixes #976.

Adapted from and fixes #1034.
2016-09-08 09:10:50 -04:00
Alex Cruice 0322c92560 Check shell profile is writeable before modifying
The `set -e` at the top of the script causes the installation to fail to
complete if the shell profile is not writeable. Checking file existence
only is not enough.

(cherry picked from commit ad0dc41899)
2016-02-10 12:04:47 +01:00
Brian McKenna 1852f7dbf3 Fix broken call to shellwords
nix-shell shebangs were broken by 9018deab

(cherry picked from commit 3baf8be1d1)
2016-02-10 12:04:18 +01:00
Philip Potter 4f3cf06c97 Verify TLS certificate before downloading binaries
The --insecure flag to curl tells curl not to bother checking if the TLS
certificate presented by the server actually matches the hostname
requested, and actually is issued by a trusted CA chain.  This almost
entirely negates any benefit from using TLS in the first place.

This removes the --insecure flag to ensure we actually have a secure
connection to the intended hostname before downloading binaries.

Manually tested locally within a dev-shell; was able to download
binaries from https://cache.nixos.org without issue.

[Note: --insecure was only used for fetching NARs, whose integrity is
verified by Nix anyway using the hash from the .narinfo. But if we can
fetch the .narinfo without --insecure, we can also fetch the .nar, so
there is not much point to using --insecure. --Eelco]
2016-01-05 14:19:46 +01:00
Fabian Schmitthenner 0eb200e569 propagate NIX_BUILD_SHELL also in pure builds document NIX_BUILD_SHELL in the nix-shell command documentation 2016-01-05 14:11:20 +01:00
Brian McKenna 9018deab6c Use shellwords for nix-shell shebang
Previously we can't have quoted arguments.

This now allows us to use things like `ghcWithPackages`
2015-12-07 11:31:26 +11:00
Eelco Dolstra c0d4173263 Set default binary-caches-parallel-connections to 25
Some benchmarking suggested this as a good value. Running

  $ benchmark -f ... -t 25 -- sh -c 'rm -f /nix/var/nix/binary-cache*; nix-store -r /nix/store/x5z8a2yvz8h6ccmhwrwrp9igg03575jg-nixos-15.09.git.5fd87e1M.drv --dry-run --option binary-caches-parallel-connections <N>'

gave the following mean elapsed times for these values of N:

N=10:  3.3541
N=20:  2.9320
N=25:  2.6690
N=30:  2.9417
N=50:  3.2021
N=100: 3.5718
N=150: 4.2079

Memory usage is also reduced (N=150 used 186 MB, N=25 only 68 MB).

Closes #708.
2015-11-25 17:13:11 +01:00
Jude Taylor 279fa8f618 reintroduce host deps in tandem with sandbox profiles 2015-11-21 15:57:06 -08:00
Eelco Dolstra 9ee15abe30 Fix bad characters in "copying 7 missing paths from ..." 2015-11-10 16:12:26 +01:00
Shea Levy fef8c3a5ab resolve-system-dependencies.pl: Simplify union impl
Patch by @pikajude
2015-10-21 18:18:03 -04:00
Jude Taylor f5a7739171 appropriately handle lock acquisition failures in resolve-system-dependencies.pl 2015-10-21 14:38:35 -07:00
Jude Taylor ff6953cb03 Add resolve-system-dependencies.pl 2015-10-21 12:38:52 -07:00
Eelco Dolstra bec3c31608 nix-prefetch-url: Rewrite in C++ 2015-10-01 16:47:43 +02:00
Utku Demir a49514a2e2 Also set CURLOPT_SSL_VERIFYHOST=0 when "verify-https-binary-caches" is false
This makes that option even more insecure, by also not checking the SSL host.

But without this parameter, one can still get SSL errors even when
"verify-https-binary-caches" is false, which is unexpected IMO.
2015-09-25 22:34:08 +03:00
Eelco Dolstra 984c5cdc50 Drop newline in error message 2015-08-07 05:32:17 +02:00
Eelco Dolstra ccf31dbc25 nix-copy-closure: Add -v flag
And make exportPath() less spammy by default.
2015-07-20 01:52:07 +02:00
Eelco Dolstra e012c126db Revert "add the manpath to the installer"
This reverts commit 76f985b92d. We
shouldn't mess with $MANPATH, because on some "man" implementations
(like NixOS'), the default value on $MANPATH is derived from $PATH. So
if you set $MANPATH, you lose the default locations.
2015-07-01 13:04:15 +02:00
Eelco Dolstra c48617671d nix-channel: Fix bogus error message caused by 8a84bd8c8b 2015-06-12 01:56:34 +02:00
Eelco Dolstra f2b67fbf2a nix-push: Support -j
Fixes #548.
2015-06-08 14:16:06 +02:00
Eelco Dolstra bf8cc4e9b6 Update cacert locations 2015-06-08 11:40:35 +02:00