1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 10:19:36 +01:00
Commit graph

10939 commits

Author SHA1 Message Date
Eelco Dolstra
3da9a9241c Convert option descriptions to Markdown 2021-01-13 14:18:04 +01:00
Eelco Dolstra
4e9cec79bf
Merge pull request #4444 from matthewbauer/unset-curproc-arch-affinity
Set kern.curproc_arch_affinity=0 to escape Rosetta
2021-01-13 12:16:53 +01:00
Eelco Dolstra
fbfa70dc02
Merge pull request #4443 from rickynils/prefer-local-build-respect-zero-max-jobs
Don't let 'preferLocalBuild' override 'max-jobs=0'
2021-01-13 12:15:54 +01:00
Rickard Nilsson
0ca1a50132 Remove a redundant condition in DerivationGoal::tryLocalBuild() 2021-01-13 10:13:51 +01:00
Eelco Dolstra
2f463e90ed Add 'nix profile history' command
Replaces 'nix-env --list-generations'. Similar to 'nix profile
diff-closures' but shows only the changes in top-level packages.
2021-01-12 23:53:53 +01:00
Eelco Dolstra
29007f8bc6 nix profile info -> nix profile list 2021-01-12 19:57:05 +01:00
Matthew Bauer
f69820417f Set kern.curproc_arch_affinity=0 to escape Rosetta
By default, once you enter x86_64 Rosetta 2, macOS will try to run
everything in x86_64. So an x86_64 Nix will still try to use x86_64
even when system = aarch64-darwin. To avoid this we can set
kern.curproc_arch_affinity sysctl. With kern.curproc_arch_affinity=0,
we ignore this preference.

This is based on how
https://opensource.apple.com/source/system_cmds/system_cmds-880.40.5/arch.tproj/arch.c.auto.html
works. Completely undocumented, but seems to work!

Note, you can verify this works with this impure Nix expression:

```
  {
    a = derivation {
      name = "a";
      system = "aarch64-darwin";
      builder = "/bin/sh";
      args = [ "-e" (builtins.toFile "builder" ''
        [ "$(/usr/bin/arch)" = arm64 ]
        [ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ]
        [ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ]
        /usr/bin/touch $out
      '') ];
    };

    b = derivation {
      name = "b";
      system = "x86_64-darwin";
      builder = "/bin/sh";
      args = [ "-e" (builtins.toFile "builder" ''
        [ "$(/usr/bin/arch)" = i386 ]
        [ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ]
        [ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ]
        /usr/bin/touch $out
      '') ];
    };
  }
```
2021-01-11 22:40:21 -06:00
Rickard Nilsson
44fd7a05b6 Don't let 'preferLocalBuild' override 'max-jobs=0'
This resolves #3810 by changing the behavior of `max-jobs = 0`, so
that specifying the option also avoids local building of derivations
with the attribute `preferLocalBuild = true`.
2021-01-12 01:28:00 +01:00
Eelco Dolstra
6254b1f5d2 Add 'nix store delete' command 2021-01-11 19:46:59 +01:00
Eelco Dolstra
77c9ceda4b Tweak 2021-01-11 19:42:24 +01:00
Eelco Dolstra
93ad6430ed nix store prefetch-tarball -> nix flake prefetch 2021-01-11 12:36:39 +01:00
Eelco Dolstra
7480f2bf20
Merge pull request #4435 from DanilaFe/flake-input-types
Allow Flake inputs to accept boolean and integer attributes
2021-01-11 11:38:53 +01:00
Eelco Dolstra
fdcd62eec5 Add 'nix store gc' command 2021-01-10 23:29:14 +01:00
Danila
1db3f84bac
Upcase "Boolean" in Flake attribute type error
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-01-08 16:12:21 -08:00
Eelco Dolstra
e21aee58f6 Fix tests 2021-01-08 14:17:06 +01:00
Eelco Dolstra
17beae299d Support binary unit prefixes in command line arguments 2021-01-08 12:51:19 +01:00
Eelco Dolstra
6548b89cc4 string2Int(): Return std::optional 2021-01-08 12:22:21 +01:00
Eelco Dolstra
29a445840a Remove unused mkFlag1 2021-01-08 11:42:44 +01:00
Eelco Dolstra
1d4954e73e Remove mkFlag integer specialisation 2021-01-08 11:40:36 +01:00
Eelco Dolstra
48a9be2aab Remove mkIntFlag 2021-01-08 10:44:55 +01:00
Danila Fedorin
ba0f841a07 Use switch statement instead of sequence of ifs 2021-01-08 03:13:42 +00:00
Danila Fedorin
93f1678ec6 Allow Flake inputs to accept boolean and integer attributes
I believe that this makes it possible to do things like
Git inputs with submodules, but it also likely applies
to other input types from libfetchers.
2021-01-08 01:53:57 +00:00
Eelco Dolstra
920e6a6920
Merge pull request #4434 from NixOS/nix-prefetch
Add 'nix store prefetch-{file,tarball}'
2021-01-07 22:22:30 +01:00
Eelco Dolstra
0813350349 Add 'nix store prefetch-{file,tarball}'
These replace nix-prefetch-url and nix-prefetch-url --unpack,
respectively.
2021-01-07 21:51:46 +01:00
Eelco Dolstra
0df69d96e0 Make sodium a required dependency 2021-01-06 17:56:53 +01:00
Eelco Dolstra
9374c2baea Add commands for generating secret/public keys 2021-01-06 17:49:31 +01:00
Eelco Dolstra
555152ffe8 crypto.cc: API cleanup and add generate() / to_string() methods 2021-01-06 17:04:46 +01:00
Eelco Dolstra
146af4ee9b Move sodium_init() call 2021-01-06 16:43:09 +01:00
Eelco Dolstra
3edcb198e5
Merge pull request #4310 from matthewbauer/rosetta2-extra-platforms
Add x86_64-darwin and aarch64 to "extra-platforms" automatically when Rosetta2 is detected
2021-01-06 11:31:13 +01:00
Eelco Dolstra
1af0a165d4 nix build: Add outro message 2021-01-05 12:00:23 +01:00
Eelco Dolstra
491ba8d1c4 Log fast builds/substitutions with a lower priority 2021-01-05 12:00:23 +01:00
Eelco Dolstra
101b15663b Log build/substitution finishes 2021-01-05 12:00:23 +01:00
Eelco Dolstra
846c028609 Fix prompting 2021-01-05 12:00:23 +01:00
Eelco Dolstra
07ba1eb67e Progress bar: Handle verify 2021-01-05 12:00:23 +01:00
Eelco Dolstra
2f512dd29f Move actEvaluate so it doesn't include actLockFlake 2021-01-05 12:00:23 +01:00
Eelco Dolstra
e6ca275e23 Show queryMissing() in the progress bar 2021-01-05 12:00:23 +01:00
Eelco Dolstra
562a6d2361 Spinner 2021-01-05 12:00:23 +01:00
Eelco Dolstra
966256c507 Show flake lock file updating in the progress bar 2021-01-05 12:00:23 +01:00
Eelco Dolstra
ed80589a07 Progress bar: Add a key to show what paths remain to be built/substituted 2021-01-05 12:00:23 +01:00
Eelco Dolstra
2392688a2d Move method 2021-01-05 12:00:23 +01:00
Eelco Dolstra
4979bd468a Replace LogFormat::barWithLogs with a setting
This will make it easier to add more settings to the progress bar.
2021-01-05 12:00:23 +01:00
Eelco Dolstra
99bb7aaf80 Fix resetting the terminal with '-L'
Using '-L' caused another call to setLogFormat(), which caused another
ProgressBar to be created. But the ProgressBar should be a singleton.

To do: remove LogFormat::barWithLogs. '-L' should be a setting of the
ProgressBar, not a different log format.
2021-01-05 12:00:23 +01:00
Eelco Dolstra
29ada5105b Disable the progress bar if stdout is redirected 2021-01-05 12:00:23 +01:00
Eelco Dolstra
4b711bf3ce Fix crash, tweaks 2021-01-05 12:00:23 +01:00
Eelco Dolstra
f90b12098d Show downloads 2021-01-05 12:00:23 +01:00
Eelco Dolstra
208425bd12 Show duration of running builds 2021-01-05 12:00:23 +01:00
Eelco Dolstra
256d6427fa Put builds/substitutes under the right progress bar 2021-01-05 12:00:23 +01:00
Eelco Dolstra
83f47e7fb1 Show failure / evaluation 2021-01-05 12:00:23 +01:00
Eelco Dolstra
dc0bac99dd Add activity for evaluation 2021-01-05 12:00:23 +01:00
Eelco Dolstra
8f92b7f0a1 Style change 2021-01-05 12:00:23 +01:00