aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
AgeCommit message (Collapse)Author
2019-10-22Add start of 'nix profile' commandEelco Dolstra
2019-10-15Support non-x86_64-linux system types in flakesEelco Dolstra
A command like $ nix run nixpkgs#hello will now build the attribute 'packages.${system}.hello' rather than 'packages.hello'. Note that this does mean that the flake needs to export an attribute for every system type it supports, and you can't build on unsupported systems. So 'packages' typically looks like this: packages = nixpkgs.lib.genAttrs ["x86_64-linux" "i686-linux"] (system: { hello = ...; }); The 'checks', 'defaultPackage', 'devShell', 'apps' and 'defaultApp' outputs similarly are now attrsets that map system types to derivations/apps. 'nix flake check' checks that the derivations for all platforms evaluate correctly, but only builds the derivations in 'checks.${system}'. Fixes #2861. (That issue also talks about access to ~/.config/nixpkgs and --arg, but I think it's reasonable to say that flakes shouldn't support those.) The alternative to attribute selection is to pass the system type as an argument to the flake's 'outputs' function, e.g. 'outputs = { self, nixpkgs, system }: ...'. However, that approach would be at odds with hermetic evaluation and make it impossible to enumerate the packages provided by a flake.
2019-10-08Move addRegistrOverridesEelco Dolstra
2019-10-08uri -> url for consistencyEelco Dolstra
2019-09-22nix flake info --json: Get rid of duplicate getFlake() callEelco Dolstra
Also fix some gcc warnings.
2019-09-19nix flake check: Validate nixosConfigurations outputsEelco Dolstra
2019-09-18Record original flakerefs in the lock file againEelco Dolstra
If 'input.<name>.uri' changes, then the entry in the lockfile for input <name> should be considered stale. Also print some messages when lock file entries are added/updated.
2019-09-10nix flake check: Check hydraJobsEelco Dolstra
2019-09-10nix flake check: Do some basic checks on NixOS modulesEelco Dolstra
Also show more position info.
2019-09-10nix flake check: Check overlaysEelco Dolstra
2019-08-30Remove 'name' attribute from flakesEelco Dolstra
This is no longer needed since flakes are given an identity in the 'inputs' attribute.
2019-07-11Rename 'epoch' -> 'edition'Eelco Dolstra
2019-06-21Simplify getFlake() / fetchFlake() logicEelco Dolstra
2019-06-18Make subcommand construction in MultiCommand lazyEelco Dolstra
2019-06-18Merge pull request #2951 from NixOS/app-improvementsEelco Dolstra
App / check improvements
2019-06-18Merge pull request #2917 from CSVdB/docsEelco Dolstra
Updated flake documentation
2019-06-18Updated documentationEelco Dolstra
2019-06-18nix flake check: Ignore legacyPackagesEelco Dolstra
2019-06-17nix flake check: Warn about unknown flake outputsEelco Dolstra
2019-06-17nix flake check: Check appsEelco Dolstra
2019-06-17nix flake info --json: Revive enumerating the outputsEelco Dolstra
2019-06-05Move flake-related stuff to src/libexpr/flakeEelco Dolstra
2019-06-04Make non-flake inputs lazyEelco Dolstra
Also add a proper test for non-flake inputs.
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-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-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-29Put flake-related stuff in its own namespaceEelco 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-28nix flake info: Add missing newlineEelco Dolstra
2019-05-28printFlakeInfo: Separate JSON outputEelco 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-28Store SourceInfo in Flake and NonFlakeEelco Dolstra
This deduplicates some shared fields. Factoring out the commonality is useful in places like makeFlakeValue().
2019-05-22Fetch the flake registry from the NixOS/flake-registry repoEelco Dolstra
2019-05-22Check the flake epochEelco Dolstra
Closes #2883.
2019-05-22nix flake deps: Print flake dependenciesEelco Dolstra
2019-05-22Move flake-related flags into a separate classEelco Dolstra
Also, rename --dont-save-lock-file to --no-save-lock-file and change noRegistries to useRegistries.
2019-05-22Improve FlakeCommandEelco Dolstra
It now handles commonality like calling getFlake() and resolving relative local flake refs. Fixes #2822.
2019-05-17Lockfile handling in `resolveFlake` is fixedNick Van den Broeck
2019-05-16Give errors in resolveFlakeNick Van den Broeck
If DontUpdate but the lockfile isn't correct
2019-05-16Fixed issue 65Nick Van den Broeck
lockfile updating
2019-05-07Fixed Flake data type and flake fetchingNick Van den Broeck
2019-04-30Merge remote-tracking branch 'tweag/flakeFlags' into flakesEelco Dolstra
2019-04-30Fixed issue #13Nick Van den Broeck
2019-04-30Fix flag registry orderNick Van den Broeck