aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake
AgeCommit message (Collapse)Author
2023-04-03Allow open switch-enum in 5 placesRobert Hensing
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2023-03-20Move enabled experimental feature to libutil structJohn Ericson
This is needed in subsequent commits to allow the settings and CLI args infrastructure itself to read this setting.
2023-03-19Only allow reference lock files when allow-dirty is setLinus Heckemann
2023-03-14Apply review suggestionsLinus Heckemann
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-03-13Allow specifying alternative paths for reading/writing flake locksLinus Heckemann
This allows having multiple separate lockfiles for a single project, which can be useful for testing against different versions of nixpkgs; it also allows tracking custom input overrides for remote flakes without requiring local clones of these flakes. For example, if I want to build Nix against my locally pinned nixpkgs, and have a lock file tracking this override independently of future updates to said nixpkgs: nix flake lock --output-lock-file /tmp/nix-flake.lock --override-input nixpkgs flake:nixpkgs nix build --reference-lock-file /tmp/nix-flake.lock Co-Authored-By: Will Fancher <elvishjerricco@gmail.com>
2023-02-22flakes: Differentiate `self.outPath` and `self.sourceInfo.outPath`Robert Hensing
It would be incorrect to say that the `sourceInfo` has an `outPath` that isn't the root. `sourceInfo` is about the root, whereas only the flake may not be about the root. Thanks Eelco for pointing that out.
2023-02-22flakes: Ensure that `self.outPath == ./.`Robert Hensing
Users expect `self` to refer to the directory where the `flake.nix` file resides.
2023-02-01Fix clang compilationEelco Dolstra
2023-01-19Add tests for error traces, and fixesGuillaume Maudoux
2023-01-19Revert "Revert "Merge pull request #6204 from layus/coerce-string""Guillaume Maudoux
This reverts commit 9b33ef3879a764bed4cc2404a08344c3a697a646.
2023-01-18Revert "Merge pull request #6204 from layus/coerce-string"Robert Hensing
This reverts commit a75b7ba30f1e4f8b15e810fd18e63ee9552e0815, reversing changes made to 9af16c5f742300e831a2cc400e43df1e22f87f31.
2023-01-11Split `OutputsSpec` and `ExtendedOutputsSpec`, use the former moreJohn Ericson
`DerivedPath::Built` and `DerivationGoal` were previously using a regular set with the convention that the empty set means all outputs. But it is easy to forget about this rule when processing those sets. Using `OutputSpec` forces us to get it right.
2023-01-11Rename `OutputPath` -> `ExtendedOutputPath`John Ericson
Do this prior to making a new more limitted `OutputPath` we will use in more places.
2023-01-11Improve `OutputsSpec` slightlyJohn Ericson
A few little changes preparing for the rest.
2023-01-10Make clear that `StorePathWithOutputs` is a deprecated typeJohn Ericson
- Add a comment - Put `OutputsSpec` in a different header (First part of #6815) - Make a few stray uses of it in new code use `DerivedPath` instead.
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
2022-12-20Merge pull request #7451 from edolstra/abstract-posEelco Dolstra
Introduce AbstractPos
2022-12-16printMsg replacement by printInfoSolène Rapenne
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-14warnings: switch to info level when using a saved substituterSolène Rapenne
2022-12-13Introduce AbstractPosEelco Dolstra
This makes the position object used in exceptions abstract, with a method getSource() to get the source code of the file in which the error originated. This is needed for lazy trees because source files don't necessarily exist in the filesystem, and we don't want to make libutil depend on the InputAccessor type in libfetcher.
2022-12-12Fix stack context notes to not rely on orderJohn Ericson
Make everything be in the form "while ..." (most things were already), and in particular *don't* use other propositions that must go after or before specific "while ..." clauses to make sense.
2022-12-12Use get_ptr()Eelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-10-25Use _typeEelco Dolstra
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-10-23Mark flakes with .type = "flake".Shea Levy
Fixes #7186
2022-10-16Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux
2022-09-26Merge pull request #7089 from NixOS/mention-accept-flake-config-in-warningEelco Dolstra
Mention `--accept-flake-config` in the related warning
2022-09-24Mention `--accept-flake-config` in the related warningThéophane Hufschmitt
Make sure that people who run Nix in non-interactive mode (and so don't have the possibility to interactively accept the individual flake configuration settings) are aware of this flag. Fix #7086
2022-09-07WIP: broken merge but need a git checkpointGuillaume Maudoux
2022-09-06lockfile -> lock file for consistencyEelco Dolstra
2022-09-01Revert "Merge pull request #6621 from Kha/nested-follows"Eelco Dolstra
This reverts commit c530cda345377370c52a616d608de88b9d67cd40, reversing changes made to 4adcdff5c1d5f9f135c4ec61d690890443c19e6a.
2022-08-28Fix overlapping flake followsSebastian Ullrich
2022-08-28Fix nested flake input overridesSebastian Ullrich
2022-08-04libexpr/flake: remove `FIXME`Erik Arvstedt
Line 593 checks that all overrides (i.e. all elements of `lockFlags.inputOverrides`) are members of `overridesUsed`.
2022-08-04flakeref: fix commentErik Arvstedt
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-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-06-13flake.cc: Make non-flake overrides stickyAlexander Bantyev
Overrides for inputs with flake=false were non-sticky, since they changed the `original` in `flake.lock`. This fixes it, by using the same locked original for both flake and non-flake inputs.
2022-05-18Merge pull request #6544 from ncfavier/getFlake-no-write-lock-fileThéophane Hufschmitt
Do not attempt to write a lock file in builtins.getFlake
2022-05-18Do not attempt to write a lock file in builtins.getFlakeNaïm Favier
Fixes https://github.com/NixOS/nix/issues/6541
2022-05-10Allow setting bash-prompt-prefix nix develop configurationJimmy Reichley
2022-05-04Get rid of most `.at` calls (#6393)Alain Zscheile
Use one of `get` or `getOr` instead which will either return a null-pointer (with a nicer error message) or a default value when the key is missing.
2022-05-03Allow selecting derivation outputs using 'installable!outputs'Eelco Dolstra
E.g. 'nixpkgs#glibc^dev,static' or 'nixpkgs#glibc^*'.
2022-04-29Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux
2022-04-28fix errors case and wordingGuillaume Maudoux
2022-04-21store Symbols in a table as well, like positionspennae
this slightly increases the amount of memory used for any given symbol, but this increase is more than made up for if the symbol is referenced more than once in the EvalState that holds it. on average every symbol should be referenced at least twice (once to introduce a binding, once to use it), so we expect no increase in memory on average. symbol tables are limited to 2³² entries like position tables, and similar arguments apply to why overflow is not likely: 2³² symbols would require as many string instances (at 24 bytes each) and map entries (at 24 bytes or more each, assuming that the map holds on average at most one item per bucket as the docs say). a full symbol table would require at least 192GB of memory just for symbols, which is well out of reach. (an ofborg eval of nixpks today creates less than a million symbols!)