aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
AgeCommit message (Collapse)Author
2021-04-05Use `BuildableReq` for `buildPaths` and `ensurePath`John Ericson
This avoids an ambiguity where the `StorePathWithOutputs { drvPath, {} }` could mean "build `brvPath`" or "substitute `drvPath`" depending on context. It also brings the internals closer in line to the new CLI, by generalizing the `Buildable` type is used there and makes that distinction already. In doing so, relegate `StorePathWithOutputs` to being a type just for backwards compatibility (CLI and RPC).
2021-03-19Restore 'nix flake info' as a deprecated aliasEelco Dolstra
2021-03-16Merge 'nix flake {info,list-inputs}' into 'nix flake metadata'Eelco Dolstra
Fixes #4613.
2021-03-16--override-input: Imply --no-write-lock-fileEelco Dolstra
Fixes #3779.
2021-02-26nix flake update: Recreate the lock fileEelco Dolstra
This is probably what most people expect it to do. Fixes #3781. There is a new command 'nix flake lock' that has the old behaviour of 'nix flake update', i.e. it just adds missing lock file entries unless overriden using --update-input.
2021-02-17Throw an error if --arg / --argstr is used with a flakeEelco Dolstra
Fixes #3949.
2021-02-17nix flake show: Handle 'overlays' outputEelco Dolstra
Fixes #4542.
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2021-01-11nix store prefetch-tarball -> nix flake prefetchEelco Dolstra
2020-12-23Add 'nix flake' manpagesEelco Dolstra
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-12Add ValueType checking functions for types that have the same NormalTypeSilvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger
2020-10-28Capitalize JSON for consistencyMatthew Kenigsberg
2020-10-26Move ExplicitEelco Dolstra
2020-10-09Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-10-06Remove static variable name clashesEelco Dolstra
This was useful for an experiment with building Nix as a single compilation unit. It's not very useful otherwise but also doesn't hurt...
2020-09-25stdout_ -> coutJohn Ericson
Better to get creative than just sprinkle arbitrary underscores.
2020-09-04Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-08-17Add 'nix dump-args' to dump all commands/flags for manpage generationEelco Dolstra
2020-08-07Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-08-07Make --no-eval-cache a global settingEelco Dolstra
2020-07-30Pass system to bundlerMatthew Bauer
2020-07-30exporter -> bundlerMatthew Bauer
2020-07-30Merge remote-tracking branch 'origin/master' into fix-and-ci-static-buildsMatthew Bauer
2020-07-30Handle exporters checking correctlyMatthew Bauer
2020-07-30Add "export" to NixMatthew Bauer
This adds a ‘nix export’ command which hooks into nix-bundle. It can be used in a similar way as nix-bundle, with the benefit of hooking into the new “app” functionality. For instance, $ nix export nixpkgs#jq $ ./jq --help jq - commandline JSON processor [version 1.6] ... $ scp jq machine-without-nix: $ ssh machine-without-nix ./jq jq - commandline JSON processor [version 1.6] ... Note that nix-bundle currently requires Linux to run. Other exporters might not have that requirement. “exporters” are meant to be reusable, so that, other repos can implement their own bundling. Fixes #3705
2020-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-29nix run: Use packages/legacyPackages as fallback if there is no app definitionEelco Dolstra
'nix run' will try to run $out/bin/<name>, where <name> is the derivation name (excluding the version). This often works well: $ nix run nixpkgs#hello Hello, world! $ nix run nix -- --version nix (Nix) 2.4pre20200626_adf2fbb $ nix run patchelf -- --version patchelf 0.11.20200623.e61654b $ nix run nixpkgs#firefox -- --version Mozilla Firefox 77.0.1 $ nix run nixpkgs#gimp -- --version GNU Image Manipulation Program version 2.10.14 though not always: $ nix run nixpkgs#git error: unable to execute '/nix/store/kp7wp760l4gryq9s36x481b2x4rfklcy-git-2.25.4/bin/git-minimal': No such file or directory
2020-06-23nix flake init: Use git add --forceEelco Dolstra
2020-06-22nix flake check: Don't build appsEelco Dolstra
This was inconsistent since we're not building 'packages' or 'defaultPackage' either. Closes #3726.
2020-06-17Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-11Represent 'follows' inputs explicitly in the lock fileEelco Dolstra
This fixes an issue where lockfile generation was not idempotent: after updating a lockfile, a "follows" node would end up pointing to a new copy of the node, rather than to the original node.
2020-06-08nix flake: Require 'flakes' featureEelco Dolstra
2020-06-08Add completion for --update-inputEelco Dolstra
2020-06-05Fix completion of --templateEelco Dolstra
2020-06-04nix flake init: Add a '--template' flagEelco Dolstra
The initial contents of the flake is specified by the 'templates.<name>' or 'defaultTemplate' output of another flake. E.g. outputs = { self }: { templates = { nixos-container = { path = ./nixos-container; description = "An example of a NixOS container"; }; }; }; allows $ nix flake init -t templates#nixos-container Also add a command 'nix flake new', which is identical to 'nix flake init' except that it initializes a specified directory rather than the current directory.
2020-05-30Remove TreeInfoEelco Dolstra
The attributes previously stored in TreeInfo (narHash, revCount, lastModified) are now stored in Input. This makes it less arbitrary what attributes are stored where. As a result, the lock file format has changed. An entry like "info": { "lastModified": 1585405475, "narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE=" }, "locked": { "owner": "NixOS", "repo": "nixpkgs", "rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be", "type": "github" }, is now stored as "locked": { "owner": "NixOS", "repo": "nixpkgs", "rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be", "type": "github", "lastModified": 1585405475, "narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE=" }, The 'Input' class is now a dumb set of attributes. All the fetcher implementations subclass InputScheme, not Input. This simplifies the API. Also, fix substitution of flake inputs. This was broken since lazy flake fetching started using fetchTree internally.
2020-05-21handle circular flake dependencies in list-inputsMatthew Kenigsberg
2020-05-15Move registry-related commands from 'nix flake' to 'nix registry'Eelco Dolstra
This makes 'nix flake' less cluttered and more consistent (it's only subcommands that operator on a flake). Also, the registry is not inherently flake-related (e.g. fetchTree could also use it to remap inputs).
2020-05-11nix flake: Add completion supportEelco Dolstra
2020-05-05Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-27Improve path:// handlingEelco Dolstra
In particular, doing 'nix build /path/to/dir' now works if /path/to/dir is not a Git tree (it only has to contain a flake.nix file). Also, 'nix flake init' no longer requires a Git tree (but it will do a 'git add flake.nix' if it's a Git tree)
2020-04-20Revive 'nix search'Eelco Dolstra
It uses the evaluation cache now rather than the ad hoc JSON cache.
2020-04-20Move eval-cache.{cc,hh}Eelco Dolstra
2020-04-20Get rid of the old eval cacheEelco Dolstra
2020-04-19Store more stuff in the evaluation cacheEelco Dolstra
In particular, we store whether an attribute failed to evaluate (threw an exception) or was an unsupported type. This is to ensure that a repeated 'nix flake show' never has to evaluate anything, so it can execute without fetching the flake. With this, 'nix flake show nixpkgs/nixos-20.03 --legacy' executes in 0.6s (was 3.4s).
2020-04-18Eval cache: Don't replace real attributes with placeholdersEelco Dolstra
2020-04-17Wrap eval cache creation in a giant transactionEelco Dolstra
This speeds up the creation of the cache for the nixpkgs flake from 21.2s to 10.2s. Oddly, it also speeds up querying the cache (i.e. running 'nix flake show nixpkgs/nixos-20.03 --legacy') from 4.2s to 3.4s. (For comparison, running with --no-eval-cache takes 9.5s, so the overhead of building the SQLite cache is only 0.7s.)
2020-04-17Use a more space/time-efficient representation for the eval cacheEelco Dolstra