about summary refs log tree commit diff
path: root/src/nix/run.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-07-25 Disable CLONE_NEWUSER when it’s unavailableMatthew Bauer1-1/+4
Some kernels disable "unpriveleged user namespaces". This is unfortunate, but we can still use mount namespaces. Anyway, since each builder has its own nixbld user, we already have most of the benefits of user namespaces.
2019-02-05 Revert "Restore parent mount namespace before executing a child process"Eelco Dolstra1-2/+2
This reverts commit a0ef21262f4d5652bfb65cfacaec01d89c475a93. This doesn't work in 'nix run' and nix-shell because setns() fails in multithreaded programs, and Boehm GC mark threads are uncancellable. Fixes #2646.
2018-11-13 Restore parent mount namespace before executing a child processEelco Dolstra1-2/+2
This ensures that they can't write to /nix/store. Fixes #2535.
2018-08-19 nix run: Restore CPU affinityEelco Dolstra1-0/+3
Fixes #2359.
2018-08-09 nix run: Respect propagated-user-env-packagesEelco Dolstra1-2/+21
Also, add $path/bin to $PATH even if it doesn't exist. This makes 'man' work properly (since it looks for ../share/man relative to $PATH entries).
2018-02-26 nix run: Fix segfault on macOSEelco Dolstra1-3/+1
Note that clearenv() is not available on macOS. Fixes #1907.
2018-02-19 Update release notesEelco Dolstra1-0/+4
Also add some examples to nix --help.
2017-11-20 nix run: Fix "flag '--command' requires 2 argument(s)"Eelco Dolstra1-1/+1
2017-11-20 nix run: Fix accidental removal of /nix/store existence checkEelco Dolstra1-1/+1
Parenthetical to #1686, we don't need to create a new root if we can just bind-mount on top of the existing /nix/store.
2017-11-20 nix run: Ignore non-directories while setting up the chrootEelco Dolstra1-3/+6
Fixes #1686.
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-5/+6
Also, random cleanup to argument handling.
2017-09-28 nix run: Restore signalsEelco Dolstra1-0/+2
Otherwise Ctrl-C doesn't work.
2017-09-10 nix build: Only download the requested derivation outputsEelco Dolstra1-1/+1
Also some refactoring.
2017-09-07 nix run: Add some examplesEelco Dolstra1-0/+18
2017-09-06 nix build: Add --out-link and --no-link optionsEelco Dolstra1-1/+1
2017-08-31 More macOS build fixesEelco Dolstra1-1/+3
2017-08-31 Fix build failure on non-LinuxEelco Dolstra1-1/+1
https://hydra.nixos.org/build/59649086
2017-08-29 nix run: Flush the progress bar before starting the commandEelco Dolstra1-0/+3
2017-08-29 nix run: Add some flags for clearing/keeping the environmentEelco Dolstra1-0/+49
This is useful for testing commands in isolation. For example, $ nix run nixpkgs.geeqie -i -k DISPLAY -k XAUTHORITY -c geeqie runs geeqie in an empty environment, except for $DISPLAY and $XAUTHORITY.
2017-08-29 nix run: Allow passing a command to executeEelco Dolstra1-2/+14
E.g. nix run nixpkgs.hello -c hello --greeting Hallo Note that unlike "nix-shell --command", no quoting of arguments is necessary. "-c" (short for "--command") cannot be combined with "--" because they both consume all remaining arguments. But since installables shouldn't start with a dash, this is unlikely to cause problems.
2017-08-29 nix run: Fix chroot executionEelco Dolstra1-60/+99
Running "nix run" with a diverted store, e.g. $ nix run --store local?root=/tmp/nix nixpkgs.hello stopped working when Nix became multithreaded, because unshare(CLONE_NEWUSER) doesn't work in multithreaded processes. The obvious solution is to terminate all other threads first, but 1) there is no way to terminate Boehm GC marker threads; and 2) it appears that the kernel has a race where unshare(CLONE_NEWUSER) will still fail for some indeterminate amount of time after joining other threads. So instead, "nix run" will now exec() a single-threaded helper ("nix __run_in_chroot") that performs the actual unshare()/chroot()/exec().
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-8/+8
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-14 StorePathsCommand: Don't build installablesEelco Dolstra1-1/+1
On second though this was annoying. E.g. "nix log nixpkgs.hello" would build/download Hello first, even though the log can be fetched directly from the binary cache. May need to revisit this.
2017-04-25 StorePathCommands: Build installablesEelco Dolstra1-9/+1
So for instance "nix copy --to ... nixpkgs.hello" will build nixpkgs.hello first. It's debatable whether this is a good idea. It seems desirable for commands like "nix copy" but maybe not for commands like "nix path-info".
2017-04-25 Move code aroundEelco Dolstra1-2/+1
2017-04-25 Restructure installables handling in the "nix" commandEelco Dolstra1-16/+3
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-8/+8
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-8/+8
2016-06-02 nix run: Set a reasonable uid/gidEelco Dolstra1-0/+7
2016-06-02 nix run: Handle the case where the /nix/store mount point doesn't existEelco Dolstra1-2/+39
2016-06-02 nix run: Mount the Nix store in a private namespaceEelco Dolstra1-1/+21
This is a convenience command to allow users who are not privileged to create /nix/store to use Nix with regular binary caches. For example, $ NIX_REMOTE="local?state=$HOME/nix/var&real=/$HOME/nix/store" nix run firefox bashInteractive will download Firefox and bash from cache.nixos.org, then start a shell in which $HOME/nix/store is mounted on /nix/store.
2016-06-02 Add basic "nix run" commandEelco Dolstra1-0/+62