aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-07-14Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-07-14Disable auto-chroot if $NIX_STORE_DIR is setEelco Dolstra
Fixes #6732.
2022-07-13Simplify the check for overrides on non-existent inputsEelco Dolstra
2022-07-13Fix typo in flake.ccIkko Ashimine
non-existant -> non-existent
2022-07-12Merge pull request #6663 from Ma27/follows-invalid-inputThéophane Hufschmitt
flakes: throw an error if `follows`-declaration for an input is invalid
2022-07-12Fix debug messageEelco Dolstra
2022-07-12Move follows-check into its own functionMaximilian Bosch
2022-07-12Turn error for non-existant follows into a warningMaximilian Bosch
2022-07-12flakes: throw an error if `follows`-declaration for an input is invalidMaximilian Bosch
I recently got fairly confused why the following expression didn't have any effect { description = "Foobar"; inputs.sops-nix = { url = github:mic92/sops-nix; inputs.nixpkgs_22_05.follows = "nixpkgs"; }; } until I found out that the input was called `nixpkgs-22_05` (please note the dash vs. underscore). IMHO it's not a good idea to not throw an error in that case and probably leave end-users rather confused, so I implemented a small check for that which basically checks whether `follows`-declaration from overrides actually have corresponding inputs in the transitive flake. In fact this was done by accident already in our own test-suite where the removal of a `follows` was apparently forgotten[1]. Since the key of the `std::map` that holds the `overrides` is a vector and we have to find the last element of each vector (i.e. the override) this has to be done with a for loop in O(n) complexity with `n` being the total amount of overrides (which shouldn't be that large though). Please note that this doesn't work with nested expressions, i.e. inputs.fenix.inputs.nixpkgs.follows = "..."; which is a known problem[2]. For the expression demonstrated above, an error like this will be thrown: error: sops-nix has a `follows'-declaration for a non-existant input nixpkgs_22_05! [1] 2664a216e57169ec57d7f51be1b8383c1be83fd5 [2] https://github.com/NixOS/nix/issues/5790
2022-07-12Merge pull request #6693 from ncfavier/complete-flake-inputsThéophane Hufschmitt
Improve shell completion of flake inputs
2022-07-11Merge branch 'master' into ignore-tryBen Burdette
2022-07-11move ignore-try to EvalSettingsBen Burdette
2022-07-11use util.hh class instead of localBen Burdette
2022-07-11'tryEval' not 'try clause'Ben Burdette
2022-07-11Fix flake input completion for `InstallablesCommand`sNaïm Favier
Defers completion of flake inputs until the whole command line is parsed so that we know what flakes we need to complete the inputs of. Previously, `nix build flake --update-input <Tab>` always behaved like `nix build . --update-input <Tab>`.
2022-07-05builtins.traceVerbose: Post rebase fixesGytis Ivaskevicius
2022-07-05Add builtins.traceVerboseGytis Ivaskevicius
Co-Authored-By: Silvan Mosberger <contact@infinisil.com> Add builtins.traceVerbose tests
2022-07-05Merge pull request #6664 from Ma27/innixshell-backwards-compatThéophane Hufschmitt
nix-shell: restore backwards-compat with old nixpkgs
2022-06-29Merge pull request #6699 from tennox/better-flake-new-error-messageThéophane Hufschmitt
flakes: apply templates partially on conflicts
2022-06-29Merge pull request #6233 from flox/nix-repl-flakesThéophane Hufschmitt
Nix repl flakes
2022-06-29Merge pull request #6674 from ↵Théophane Hufschmitt
virusdave/dnicponski/scratch/dont_capture_stdout_in_nix_repl_master Don't capture `stdout` when launching subshells in `nix repl`
2022-06-29Merge pull request #6702 from ncfavier/develop-prepend-varsEelco Dolstra
nix develop: save XDG_DATA_DIRS for loadable completion
2022-06-29Merge remote-tracking branch 'origin/master' into better-flake-new-error-messageThéophane Hufschmitt
2022-06-29Merge pull request #6739 from edolstra/ignore-chroot-errorEelco Dolstra
Don't fail if we can't create ~/.local/share/nix/root
2022-06-29Don't fail if we can't create ~/.local/share/nix/rootEelco Dolstra
https://hydra.nixos.org/build/182135943
2022-06-29src/libexpr/tests/primops.cc: Quote Nix expressionsEelco Dolstra
Otherwise they don't survive reformatting, see the failure in https://github.com/NixOS/nix/pull/6721.
2022-06-29Merge pull request #6737 from centromere/fix-typoEelco Dolstra
doc: Fix typo
2022-06-29Merge pull request #6706 from lheckemann/cache-info-cache-invalidationThéophane Hufschmitt
nar-info-disk-cache: refresh nix-cache-info weekly
2022-06-28doc: Fix typoAlex Wied
2022-06-26#6699 flake init: fix trying to add unchanged fileManu [tennox]
After skipping because of being of identical content it tried to git add it.
2022-06-26#6699 flake init: Apply suggestions of @thufschmittManu [tennox]
2022-06-26Update src/nix/flake.cc Manuel
https://github.com/NixOS/nix/pull/6699#discussion_r904097147 Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-06-26Update src/nix/flake.cc Manuel
https://github.com/NixOS/nix/pull/6699#discussion_r904096906 Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-06-26fetchGit: document `shallow` argumentGuillaume Girol
2022-06-25Merge pull request #6717 from edolstra/move-flake-registryEelco Dolstra
Fetch flake-registry.json from channels.nixos.org
2022-06-25Merge pull request #6714 from edolstra/auto-chroot-storeEelco Dolstra
Automatically use a chroot store if /nix doesn't exist
2022-06-24Only do the auto chroot store on LinuxEelco Dolstra
2022-06-24Merge pull request #6698 from tweag/forbid-tilde-paths-in-pure-modeThéophane Hufschmitt
Forbid the tilde expansion in pure eval mode
2022-06-23Don't capture stdout when launching subshells in `nix repl`Dave Nicponski
2022-06-24Merge pull request #6716 from Mindavi/bugfix/castEelco Dolstra
eval-cache: cast rowId to correct type
2022-06-23Fetch flake-registry.json from channels.nixos.orgEelco Dolstra
Using fastly is slightly faster, provides some resilience due to a high stale TTL, and allows some usage metrics.
2022-06-23eval-cache: cast rowId to correct typeRick van Schijndel
Prevents errors when running with UBSan: /nix/store/j5vhrywqmz1ixwhsmmjjxa85fpwryzh0-gcc-11.3.0/include/c++/11.3.0/bits/stl_pair.h:353:4: runtime error: load of value 229, which is not a valid value for type 'AttrType'
2022-06-23[fixup] handle cache expiration in sqlite queryLinus Heckemann
2022-06-23libstore/nar-info: drop unused system fieldCole Helbling
This was unused everywhere (and even the official NixOS binary cache did not produce .narinfo files containing a "System:" field).
2022-06-23Fix typoEelco Dolstra
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-06-23Automatically use a chroot store if /nix doesn't existEelco Dolstra
Specifically, if we're not root and the daemon socket does not exist, then we use ~/.local/share/nix/root as a chroot store. This enables non-root users to download nix-static and have it work out of the box, e.g. ubuntu@ip-10-13-1-146:~$ ~/nix run nixpkgs#hello warning: '/nix' does not exists, so Nix will use '/home/ubuntu/.local/share/nix/root' as a chroot store Hello, world!
2022-06-23Merge pull request #6710 from edolstra/embedded-sandbox-shellEelco Dolstra
Embed the sandbox shell into the statically linked 'nix' binary
2022-06-23Fix typoEelco Dolstra
2022-06-23Merge pull request #6673 from asymmetric/warnThéophane Hufschmitt
libstore: improve warning message on missing sig
2022-06-23Embed the sandbox shell into the statically linked 'nix' binaryEelco Dolstra
With this, Nix will write a copy of the sandbox shell to /bin/sh in the sandbox rather than bind-mounting it from the host filesystem. This makes /bin/sh work out of the box with nix-static, i.e. you no longer get /nix/store/qa36xhc5gpf42l3z1a8m1lysi40l9p7s-bootstrap-stage4-stdenv-linux/setup: ./configure: /bin/sh: bad interpreter: No such file or directory