aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-03Install headers in the correct locationEelco Dolstra
2020-02-03Fix URL parserEelco Dolstra
Fixes #3062.
2020-02-03Fix parsing of '#nixosConfigurations."hostname".config...'Eelco Dolstra
This is not strictly speaking valid but who cares.
2020-02-03Emit narHash attributeEelco Dolstra
2020-02-02Automatically do git/hg add on flake.lockEelco Dolstra
2020-02-02Don't store fragment in FlakeRefEelco Dolstra
2020-02-02Re-read flake after updating flake.lockEelco Dolstra
Otherwise we'll evaluate the flake with the wrong metadata (rev, ...).
2020-02-02Detect circular flake importsEelco Dolstra
Fixes #2997.
2020-02-02Remove the git+ and hg+ prefixes from structured input refsEelco Dolstra
2020-02-02--tarball-ttl 0 -> --refreshEelco Dolstra
2020-02-02Substitute flake inputsEelco Dolstra
This improves reproducibility and may be faster than fetching from the original source (especially for git/hg inputs, but probably also for github inputs - our binary cache is probably faster than GitHub's dynamically generated tarballs). Unfortunately this doesn't work for the top-level flake since even if we know the NAR hash of the tree, we don't know the other tree attributes such as revCount and lastModified. Fixes #3253.
2020-02-02Add TreeInfo::computeStorePath()Eelco Dolstra
2020-02-02Add convenience overload for toRealPath()Eelco Dolstra
2020-02-02CleanupEelco Dolstra
2020-02-02Renamed ref / resolvedRef -> lockedRefEelco Dolstra
2020-02-01Remove superfluous TreeInfo::rev fieldEelco Dolstra
2020-02-01Record TreeInfo in the lock fileEelco Dolstra
Necessary for #3253.
2020-02-01Factor out TreeInfoEelco Dolstra
2020-02-01nix flake update: Imply --refreshEelco Dolstra
2020-02-01Fix testEelco Dolstra
https://hydra.nixos.org/build/111166467
2020-01-31Allow flake input specification via attributes rather than a URLEelco Dolstra
E.g. inputs.dwarffs = { type = "github"; owner = "edolstra"; repo = "dwarffs"; }; rather than inputs.dwarffs.url = github:edolstra/dwarffs;
2020-01-31CleanupEelco Dolstra
2020-01-31Change lock file format to use an attribute representation of flake refs ↵Eelco Dolstra
rather than URLs
2020-01-31Fix testEelco Dolstra
https://hydra.nixos.org/build/111146865
2020-01-31Use light box drawing symbolsEelco Dolstra
2020-01-31nix flake list-inputs: Pretty-print the treeEelco Dolstra
2020-01-31nix flake deps -> nix flake list-inputsEelco Dolstra
Also add a --json flag.
2020-01-30Use std::nulloptEelco Dolstra
2020-01-30Add 'nix flake archive' commandEelco Dolstra
This copies a flake and all its inputs recursively to a store (e.g. a binary cache). This is intended to enable long-term reproducibility for flakes. However this will also require #3253. Example: $ nix flake archive --json --to file:///tmp/my-cache nixops {"path":"/nix/store/272igzkgl1gdzmabsjvb2kb2zqbphb3p-source","inputs":{"nixops-aws":{"path":"/nix/store/ybcykw13gr7iq1pzg18iyibbcv8k9q1v-source","inputs":{}},"nixops-hetzner":{"path":"/nix/store/6yn0205x3nz55w8ms3335p2841javz2d-source","inputs":{}},"nixpkgs":{"path":"/nix/store/li3lkr2ajrzphqqz3jj2avndnyd3i5lc-source","inputs":{}}}} $ ll /tmp/my-cache total 16 -rw-r--r-- 1 eelco users 403 Jan 30 01:01 272igzkgl1gdzmabsjvb2kb2zqbphb3p.narinfo -rw-r--r-- 1 eelco users 403 Jan 30 01:01 6yn0205x3nz55w8ms3335p2841javz2d.narinfo -rw-r--r-- 1 eelco users 408 Jan 30 01:01 li3lkr2ajrzphqqz3jj2avndnyd3i5lc.narinfo drwxr-xr-x 2 eelco users 6 Jan 30 01:01 nar -rw-r--r-- 1 eelco users 21 Jan 30 01:01 nix-cache-info -rw-r--r-- 1 eelco users 404 Jan 30 01:01 ybcykw13gr7iq1pzg18iyibbcv8k9q1v.narinfo Fixes #3336.
2020-01-30Check LockedInput::computeStorePath()Eelco Dolstra
2020-01-29Add --update-input flag to update a specific flake inputEelco Dolstra
Typical usage: $ nix flake update ~/Misc/eelco-configurations/hagbard --update-input nixpkgs to update the 'nixpkgs' input of a flake while leaving every other input unchanged. The argument is an input path, so you can do e.g. '--update-input dwarffs/nixpkgs' to update an input of an input. Fixes #2928.
2020-01-29Fix flake update checkEelco Dolstra
2020-01-29Revive the flake cacheEelco Dolstra
Not that it matters a lot anymore - we respect lock files of inputs now, so we're doing a lot fewer flake lookups.
2020-01-29Clean up the lock file handling flagsEelco Dolstra
Added a flag --no-update-lock-file to barf if the lock file needs any changes. This is useful for CI systems if you're building a checkout. Fixes #2947. Renamed --no-save-lock-file to --no-write-lock-file. It is now a fatal error if the lock file needs changes but --no-write-lock-file is not given.
2020-01-29Add flag --override-input to override specific lock file entriesEelco Dolstra
E.g. $ nix flake update ~/Misc/eelco-configurations/hagbard \ --override-input 'dwarffs/nixpkgs' ../my-nixpkgs overrides the 'nixpkgs' input of the 'dwarffs' input of the top-level flake. Fixes #2837.
2020-01-28Hopefully fix macOS testEelco Dolstra
https://hydra.nixos.org/build/110879694
2020-01-28Fix --refresh with --no-netEelco Dolstra
https://hydra.nixos.org/build/110879699
2020-01-28Simplify flake testsEelco Dolstra
2020-01-28Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-01-28Shut up warningEelco Dolstra
2020-01-28Add support for tarball flake inputsEelco Dolstra
For example, $ nix flake info https://github.com/edolstra/dwarffs/archive/master.tar.gz Fixes #2929.
2020-01-27Remove debug messageEelco Dolstra
2020-01-27Add Mercurial testsEelco Dolstra
2020-01-24Respect lock files of inputs + fine-grained lock file controlEelco Dolstra
When computing a lock file, we now respect the lock files of flake inputs. This is important for usability / reproducibility. For example, the 'nixops' flake depends on the 'nixops-aws' and 'nixops-hetzner' repositories. So when the 'nixops' flake is used in another flake, we want the versions of 'nixops-aws' and 'nixops-hetzner' locked by the the 'nixops' flake because those presumably have been tested. This can lead to a proliferation of versions of flakes like 'nixpkgs' (since every flake's lock file could depend on a different version of 'nixpkgs'). This is not a major issue when using Nixpkgs overlays or NixOS modules, since then the top-level flake composes those overlays/modules into *its* version of Nixpkgs and all other versions are ignored. Lock file computation has been made a bit more lazy so it won't try to fetch all those versions of 'nixpkgs'. However, in case it's necessary to minimize flake versions, there now are two input attributes that allow this. First, you can copy an input from another flake, as follows: inputs.nixpkgs.follows = "dwarffs/nixpkgs"; This states that the calling flake's 'nixpkgs' input shall be the same as the 'nixpkgs' input of the 'dwarffs' input. Second, you can override inputs of inputs: inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>; inputs.nixops.inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>; or equivalently, using 'follows': inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>; inputs.nixops.inputs.nixpkgs.follows = "nixpkgs"; This states that the 'nixpkgs' input of the 'nixops' input shall be the same as the calling flake's 'nixpkgs' input. Finally, at '-v' Nix now prints the changes to the lock file, e.g. $ nix flake update ~/Misc/eelco-configurations/hagbard inputs of flake 'git+file:///home/eelco/Misc/eelco-configurations?subdir=hagbard' changed: updated 'nixpkgs': 'github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9' -> 'github:edolstra/nixpkgs/03f3def66a104a221aac8b751eeb7075374848fd' removed 'nixops' removed 'nixops/nixops-aws' removed 'nixops/nixops-hetzner' removed 'nixops/nixpkgs'
2020-01-24HandleLockFile -> LockFileModeEelco Dolstra
2020-01-24Give a better error message when a flake path is not a directoryEelco Dolstra
2020-01-23Merge pull request #3329 from mayflower/attrs-chownEelco Dolstra
structured-attrs: chown .attrs.* files to builder
2020-01-23structured-attrs: chown .attrs.* files to builderRobin Gloster
Otherwise `chmod .`'ing the build directory doesn't work anymore, which is done in nixpkgs if sourceRoot is set to '.'.
2020-01-22Fix coverage buildEelco Dolstra
https://hydra.nixos.org/build/110757285
2020-01-22clang fixesEelco Dolstra
https://hydra.nixos.org/build/110757171