aboutsummaryrefslogtreecommitdiff
path: root/src/nix
AgeCommit message (Collapse)Author
2022-04-07Merge remote-tracking branch 'upstream/master' into upstream-mergeBen Burdette
2022-04-06nix flake check: Warn about deprecated nixosModule outputRehno Lindeque
2022-04-05Merge pull request #6362 from thufschmitt/verbose-doctorEelco Dolstra
doctor: Always show the output
2022-04-05doctor: Always show the outputThéophane Hufschmitt
Fix https://github.com/NixOS/nix/issues/6342
2022-04-05Allow `welcomeText` when checking a flake templateThéophane Hufschmitt
Fix https://github.com/NixOS/nix/issues/6321
2022-04-01fix(run): set applyNixConfig lockFlagTom Bereknyei
2022-04-01Merge pull request #6344 from flox/profile_url_uriEelco Dolstra
profile!: consistent use of url/uri. create new version
2022-03-31Add support for impure derivationsEelco Dolstra
Impure derivations are derivations that can produce a different result every time they're built. Example: stdenv.mkDerivation { name = "impure"; __impure = true; # marks this derivation as impure outputHashAlgo = "sha256"; outputHashMode = "recursive"; buildCommand = "date > $out"; }; Some important characteristics: * This requires the 'impure-derivations' experimental feature. * Impure derivations are not "cached". Thus, running "nix-build" on the example above multiple times will cause a rebuild every time. * They are implemented similar to CA derivations, i.e. the output is moved to a content-addressed path in the store. The difference is that we don't register a realisation in the Nix database. * Pure derivations are not allowed to depend on impure derivations. In the future fixed-output derivations will be allowed to depend on impure derivations, thus forming an "impurity barrier" in the dependency graph. * When sandboxing is enabled, impure derivations can access the network in the same way as fixed-output derivations. In relaxed sandboxing mode, they can access the local filesystem.
2022-03-30profile!: consistent use of url/uri. create new versionTom Bereknyei
2022-03-30bundler: update default bundler to support new bundler APITom Bereknyei
2022-03-29Simplify the handling of the hash moduloThéophane Hufschmitt
Rather than having four different but very similar types of hashes, make only one, with a tag indicating whether it corresponds to a regular of deferred derivation. This implies a slight logical change: The original Nix+multiple-outputs model assumed only one hash-modulo per derivation. Adding multiple-outputs CA derivations changed this as these have one hash-modulo per output. This change is now treating each derivation as having one hash modulo per output. This obviously means that we internally loose the guaranty that all the outputs of input-addressed derivations have the same hash modulo. But it turns out that it doesn’t matter because there’s nothing in the code taking advantage of that fact (and it probably shouldn’t anyways). The upside is that it is now much easier to work with these hashes, and we can get rid of a lot of useless `std::visit{ overloaded`. Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2022-03-28Merge pull request #6330 from edolstra/run-remote-storeThéophane Hufschmitt
nix {run,shell}: Print a better error message if the store is not local
2022-03-28nix {run,shell}: Print a better error message if the store is not localEelco Dolstra
Closes #6317
2022-03-28nix profile install: Don't use queryDerivationOutputMap()Eelco Dolstra
Instead get the outputs from Installable::build(). This will also allow 'nix profile install' to support impure derivations. Fixes #6286.
2022-03-25Only provide builtin.{getFlake,fetchClosure} is the corresponding ↵Eelco Dolstra
experimental feature is enabled This allows writing fallback code like if builtins ? fetchClosure then builtins.fetchClose { ... } else builtins.storePath ...
2022-03-24nix: allow whitespace characters before command in replpolykernel
Before this change, processLine always uses the first character as the start of the line. This cause whitespaces to matter at the beginning of the line whereas it does not matter anywhere else. This commit trims leading white spaces of the string line so that subsequent operations can be performed on the string without explicitly tracking starting and ending indices of the string.
2022-03-24nix store make-content-addressed: Support --from / --toEelco Dolstra
2022-03-24Rename 'nix store make-content-addressable' to 'nix store ↵Eelco Dolstra
make-content-addressed'
2022-03-24fetchClosure: Allow a path to be rewritten to CA on the flyEelco Dolstra
The advantage is that the resulting closure doesn't need to be signed, so you don't need to configure any binary cache keys on the client.
2022-03-24Fix flake profile use of originalUrl vs. originalUriRok Garbas
Fixes #5872
2022-03-22nix edit: support kakouneHideaki Kawai
2022-03-22Merge pull request #6237 from obsidiansystems/store-path-string-contextEelco Dolstra
Decode string context straight to using StorePaths
2022-03-18Decode string context straight to using `StorePath`sJohn Ericson
I gather decoding happens on demand, so I hope don't think this should have any perf implications one way or the other.
2022-03-18Use Deferred when building an input-addressed drvJohn Ericson
Easier than using dummy path with input addressed.
2022-03-17Clean up `DerivationOutput`, and headersJohn Ericson
1. `DerivationOutput` now as the `std::variant` as a base class. And the variants are given hierarchical names under `DerivationOutput`. In 8e0d0689be797f9e42f9b43b06f50c1af7f20b4a @matthewbauer and I didn't know a better idiom, and so we made it a field. But this sort of "newtype" is anoying for literals downstream. Since then we leaned the base class, inherit the constructors trick, e.g. used in `DerivedPath`. Switching to use that makes this more ergonomic, and consistent. 2. `store-api.hh` and `derivations.hh` are now independent. In bcde5456cc3295061a0726881c3e441444dd6680 I swapped the dependency, but I now know it is better to just keep on using incomplete types as much as possible for faster compilation and good separation of concerns.
2022-03-17Fix `nix build --dry-run` with CA derivationsThéophane Hufschmitt
Don’t try and assume that we know the output paths when we’ve just built with `--dry-run`. Instead make `--dry-run` follow a different code path that won’t assume the knowledge of the output paths at all. Fix #6275
2022-03-15Merge pull request #6229 from obsidiansystems/refactor-hash-moduloThéophane Hufschmitt
Overhaul derivation hash modulo somewhat
2022-03-11Reduce variants for derivation hash moduloJohn Ericson
This changes was taken from dynamic derivation (#4628). It` somewhat undoes the refactors I first did for floating CA derivations, as the benefit of hindsight + requirements of dynamic derivations made me reconsider some things. They aren't to consequential, but I figured they might be good to land first, before the more profound changes @thufschmitt has in the works.
2022-03-11Deduplicate the Store downcasting with a templateJohn Ericson
2022-03-11Factor out a `LogStore` interfaceJohn Ericson
Continue progress on #5729. Just as I hoped, this uncovered an issue: the daemon protocol is missing a way to query build logs. This doesn't effect `unix://`, but does effect `ssh://`. A FIXME is left for this, so we come back to it later.
2022-03-11Rename `requireGcStore` to `GcStore::require`John Ericson
I should have done this to begin with. This will be nicer once more Store sub-interfaces exist too, to illustrate the pattern.
2022-03-07StyleEelco Dolstra
2022-03-07Explicit error in flake init/new when not in storeGuillaume Desforges
2022-03-03Factor out a `GcStore` interfaceJohn Ericson
Starts progress on #5729. The idea is that we should not have these default methods throwing "unimplemented". This is a small step in that direction. I kept `addTempRoot` because it is a no-op, rather than failure. Also, as a practical matter, it is called all over the place, while doing other tasks, so the downcasting would be annoying. Maybe in the future I could move the "real" `addTempRoot` to `GcStore`, and the existing usecases use a `tryAddTempRoot` wrapper to downcast or do nothing, but I wasn't sure whether that was a good idea so with a bias to less churn I didn't do it yet.
2022-03-03printValue(): Don't show repeated valuesEelco Dolstra
Fixes #6157.
2022-03-02Add EvalState::coerceToStorePath() helperEelco Dolstra
This is useful whenever we want to evaluate something to a store path (e.g. in get-drvs.cc). Extracted from the lazy-trees branch (where we can require that a store path must come from a store source tree accessor).
2022-03-02nix profile: Support CA derivationsEelco Dolstra
2022-03-02Move installables-related operationsEelco Dolstra
2022-03-02StyleEelco Dolstra
2022-02-28Merge pull request #6072 from Ma27/fix-nix-why-depends-non-preciseThéophane Hufschmitt
nix/why-depends: fix output when not using `--precise`
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2022-02-24Merge pull request #6089 from edolstra/dot-defaultEelco Dolstra
Replace defaultBla.$system with bla.$system.default
2022-02-24libfetchers: Rename immutable -> lockedEelco Dolstra
This is more consistent with flake terminology.
2022-02-24Merge pull request #5342 from Misterio77/add-sourcehutThéophane Hufschmitt
Add support for sourcehut input scheme
2022-02-22Update docsEelco Dolstra
2022-02-22nix flake check: Warn about deprecated flake outputsEelco Dolstra
2022-02-22Replace defaultBla.$system with bla.$system.defaultEelco Dolstra
This also simplifies some InstallableFlake logic and fixes 'nix bundle' parsing its installable twice. Fixes #5532.
2022-02-21Merge pull request #6136 from matthewbauer/profile-upgrade-verbosityEelco Dolstra
Add verbosity to nix profile upgrade
2022-02-21Apply suggestions from code reviewMatthew Bauer
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-02-21Remove std::set aliasEelco Dolstra