aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-06-07Disable EvalCache in impure modeEelco Dolstra
2019-06-07Add flake evaluation cacheEelco Dolstra
This exploits the hermetic nature of flake evaluation to speed up repeated evaluations of a flake output attribute. For example (doing 'nix build' on an already present package): $ time nix build nixpkgs:firefox real 0m1.497s user 0m1.160s sys 0m0.139s $ time nix build nixpkgs:firefox real 0m0.052s user 0m0.038s sys 0m0.007s The cache is ~/.cache/nix/eval-cache-v1.sqlite, which has entries like INSERT INTO Attributes VALUES( X'92a907d4efe933af2a46959b082cdff176aa5bfeb47a98fabd234809a67ab195', 'packages.firefox', 1, '/nix/store/pbalzf8x19hckr8cwdv62rd6g0lqgc38-firefox-67.0.drv /nix/store/g6q0gx0v6xvdnizp8lrcw7c4gdkzana0-firefox-67.0 out'); where the hash 92a9... is a fingerprint over the flake store path and the contents of the lockfile. Because flakes are evaluated in pure mode, this uniquely identifies the evaluation result.
2019-06-05Move flake-related stuff to src/libexpr/flakeEelco Dolstra
2019-06-04Shorter syntax for referencing flake outputsEelco Dolstra
Fixes #2819.
2019-06-04Eliminate duplicate fetching of the top-level flakeEelco Dolstra
2019-06-04Add commentsEelco Dolstra
2019-06-04Make non-flake inputs lazyEelco Dolstra
Also add a proper test for non-flake inputs.
2019-06-04Check hashEelco Dolstra
2019-06-04Don't register invalid paths as GC rootsEelco Dolstra
Unfortunately this doesn't work. Maybe we should keep separate roots for each path.
2019-06-04Rename dep -> inputEelco Dolstra
Also use nlohmann::json range-based for.
2019-06-04Move LockFile and related types to a separate fileEelco Dolstra
2019-06-04Fix GC closure generationEelco Dolstra
2019-06-04Make flake input fetching lazyEelco Dolstra
As long as the flake input is locked, it is now only fetched when it is evaluated (e.g. "nixpkgs" is fetched when "inputs.nixpkgs.<something>" is evaluated). This required adding an "id" attribute to the members of "inputs" in lockfiles, e.g. "inputs": { "nixpkgs/release-19.03": { "id": "nixpkgs", "inputs": {}, "narHash": "sha256-eYtxncIMFVmOHaHBtTdPGcs/AnJqKqA6tHCm0UmPYQU=", "nonFlakeInputs": {}, "uri": "github:edolstra/nixpkgs/e9d5882bb861dc48f8d46960e7c820efdbe8f9c1" } } because the flake ID needs to be known beforehand to construct the "inputs" attrset. Fixes #2913.
2019-06-03Fix clang compilation errorEelco Dolstra
https://hydra.nixos.org/build/94332344 https://stackoverflow.com/questions/46114214/lambda-implicit-capture-fails-with-variable-declared-from-structured-binding
2019-06-03Made epochs more fine-grainedNick Van den Broeck
Fixes #2894
2019-06-03Add 'nix app' commandEelco Dolstra
This is like 'nix run', except that the command to execute is defined in a flake output, e.g. defaultApp = { type = "app"; program = "${packages.blender_2_80}/bin/blender"; }; Thus you can do $ nix app blender-bin to start Blender from the 'blender-bin' flake. In the future, we can extend this with sandboxing. (For example we would want to be able to specify that Blender should not have network access by default and should only have access to certain paths in the user's home directory.)
2019-06-03Bindings: Add convenience method for requiring an attributeEelco Dolstra
2019-06-03Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-06-01Fix segfault in builtin fetchurl with hashed mirrors + SRI hashesEelco Dolstra
2019-05-31DohEelco Dolstra
2019-05-31Fix handling of bare flakerefs containing a colonEelco Dolstra
2019-05-31Automatically determine subdir for path flakesEelco Dolstra
This means that in a flake in a subdirectory of a Git repo, you can now do $ nix build rather than the inconvenient $ nix build ../..?dir=foo/bar
2019-05-31Allow bare flakerefs as installablesEelco Dolstra
So now $ nix build blender-bin works and builds the default package from that flake. You don't need to add a colon at the end anymore.
2019-05-31Fix reading the lockfile of a flake in a subdirectoryEelco Dolstra
2019-05-31Add operator << for LockFileEelco Dolstra
Useful for debugging.
2019-05-31Support 'dir' and other parameters in path flakerefsEelco Dolstra
2019-05-31Show hash mismatch warnings in SRI formatEelco Dolstra
2019-05-31Rename requires -> inputs, provides -> outputsEelco Dolstra
Issue #2828.
2019-05-29nix flake info --json: List the "provides"Eelco Dolstra
It also lists the contents of "checks" and "packages". For example: $ nix flake info --json | jq { "branch": "HEAD", "description": "The purely functional package manager", "epoch": 2019, "id": "nix", "lastModified": 1559161142, "path": "/nix/store/2w2qla8735dbxah8gai8r1nsbf5x4f5d-source", "provides": { "checks": { "binaryTarball": {}, "nix-copy-closure": {}, "perlBindings": {}, "remoteBuilds": {}, "setuid": {} }, "defaultPackage": {}, "devShell": {}, "hydraJobs": {}, "packages": { "nix": {}, "nix-perl-bindings": {} } }, "revCount": 6955, "revision": "8cb24e04e8b6cc60e2504733afe78e0eadafcd98", "uri": "/home/eelco/Dev/nix" } Fixes #2820.
2019-05-29Hack: Use legacyPackages from NixpkgsEelco Dolstra
Nixpkgs doesn't provide a clean "packages" set yet, so until that's the case, look for packages in "legacyPackages" as well.
2019-05-29nix flake check: Use read-only mode if we're not buildingEelco Dolstra
2019-05-29nix flake check: Check defaultPackage, devShell and packagesEelco Dolstra
2019-05-29Add 'nix flake check' commandEelco Dolstra
This evaluates all the 'provides' of a flake and builds the 'check' attributes.
2019-05-29Remove makeFlakeValue()Eelco Dolstra
2019-05-29Put flake-related stuff in its own namespaceEelco Dolstra
2019-05-29Make unsupported flake attributes a fatal errorEelco Dolstra
2019-05-29Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-05-29bump cpptoml to v0.1.1Ding Xiang Fei
2019-05-29Get last commit time of github flakesEelco Dolstra
2019-05-29Add date of last commit to SourceInfoEelco Dolstra
This is primarily useful for version string generation, where we need a monotonically increasing number. The revcount is the preferred thing to use, but isn't available for GitHub flakes (since it requires fetching the entire history). The last commit timestamp OTOH can be extracted from GitHub tarballs.
2019-05-28Iterate over referencesEelco Dolstra
2019-05-28Merge branch 'attrPaths' of https://github.com/NinjaTrappeur/nixEelco Dolstra
2019-05-28nix flake info: Add missing newlineEelco Dolstra
2019-05-28printFlakeInfo: Separate JSON outputEelco Dolstra
2019-05-28callFlake(): Emit source info attributes for non-flake dependenciesEelco Dolstra
2019-05-28nix flake deps: Remove --json flag for nowEelco Dolstra
It doesn't produce valid JSON at the moment (but a concatenation of JSON objects). Anyway we probably should merge this command info 'nix flake info'.
2019-05-28printFlakeInfo/printNonFlakeInfo: Factor out commonalityEelco Dolstra
2019-05-28nix flake info/deps: Stop progress bar before printing outputEelco Dolstra
2019-05-28Remove redundant resolvedRef fields since they're already in SourceInfoEelco Dolstra
2019-05-28Rename contentHash -> narHash for consistencyEelco Dolstra