aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-04-03getFlake: In pure mode, check that the argument is an immutable flakerefEelco Dolstra
2020-04-02Temporary backward compatibility hackEelco Dolstra
2020-04-02Don't barf on registry parse errorsEelco Dolstra
2020-04-02Respect the narHash attribute in more input typesEelco Dolstra
call-flake.nix now passes node.info.narHash to fetchTree. This ensures that dirty Git trees work even in pure mode.
2020-04-02PathInput: Add some methodsEelco Dolstra
2020-04-02Improve error messageEelco Dolstra
2020-04-02Change lastModified to the number of seconds in the epochEelco Dolstra
'lastModifiedDate' is now a string representing the equivalent date/time.
2020-04-02Move parseTreeInfo()Eelco Dolstra
2020-04-02fetchTree: Support integer attributesEelco Dolstra
2020-04-02Add 'path' fetcherEelco Dolstra
This fetchers copies a plain directory (i.e. not a Git/Mercurial repository) to the store (or does nothing if the path is already a store path). One use case is to pin the 'nixpkgs' flake used to build the current NixOS system, and prevent it from being garbage-collected, via a system registry entry like this: { "from": { "id": "nixpkgs", "type": "indirect" }, "to": { "type": "path", "path": "/nix/store/rralhl3wj4rdwzjn16g7d93mibvlr521-source", "lastModified": 1585388205, "rev": "b0c285807d6a9f1b7562ec417c24fa1a30ecc31a" }, "exact": true } Note the fake "lastModified" and "rev" attributes that ensure that the flake gives the same evaluation results as the corresponding Git/GitHub inputs.
2020-04-02DohEelco Dolstra
2020-04-02nix-env: Refuse to operate on a new-style profileEelco Dolstra
This prevents users from accidentally nuking their profile via nix-env.
2020-04-02nix flake info --json: Show TreeInfoEelco Dolstra
2020-04-01Support registry entries that must match exactlyEelco Dolstra
An example use is for pinning the "nixpkgs" entry the system-wide registry to a particular store path. Inexact matches (e.g. "nixpkgs/master") should still use the global registry.
2020-04-01Registry: Use a struct instead of a tuple for entriesEelco Dolstra
2020-04-01Add a system-wide flake registry /etc/nix/registry.jsonEelco Dolstra
One application for this is pinning the 'nixpkgs' flake to the exact revision used to build the NixOS system, e.g. { "flakes": [ { "from": { "id": "nixpkgs", "type": "indirect" }, "to": { "owner": "NixOS", "repo": "nixpkgs", "type": "github", "rev": "b0c285807d6a9f1b7562ec417c24fa1a30ecc31a" } } ], "version": 2 }
2020-04-01Set version properlyEelco Dolstra
2020-04-01Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-03-31TypoEelco Dolstra
2020-03-31Merge pull request #3460 from NixOS/dev-shellEelco Dolstra
Backport 'nix dev-shell' from the flakes branch
2020-03-31Merge pull request #3463 from Ninlives/placeholder-passAsFileEelco Dolstra
fix placeholder not substituted in passAsFile
2020-03-31nix shell -> nix dev-shellEelco Dolstra
2020-03-31fix placeholder not substituted in passAsFilemlatus
2020-03-30Backport 'nix dev-shell' from the flakes branchEelco Dolstra
This also adds a '--profile' option to 'nix build' (replacing 'nix-env --set').
2020-03-30Fix macOS buildEelco Dolstra
2020-03-30Makefile cleanupEelco Dolstra
2020-03-30Remove global -I flagsEelco Dolstra
(cherry picked from commit 2c692a3b144523bca68dd6de618124ba6c9bb332)
2020-03-30Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-03-30Remove global -I flagsEelco Dolstra
2020-03-30Move fetchers from libstore to libfetchersEelco Dolstra
2020-03-30flake.lock: UpdateEelco Dolstra
Flake input changes: * Updated 'nixpkgs': 'github:NixOS/nixpkgs/81fa5f4501372671b464fe0104fe47f5327b46fe' -> 'github:NixOS/nixpkgs/b88ff468e9850410070d4e0ccd68c7011f15b2be'
2020-03-30Fix segfaultEelco Dolstra
2020-03-28nix flake info --json: Dump attr-style flakerefEelco Dolstra
2020-03-28Warn about --override-input / --update-input flags that don't match an inputEelco Dolstra
2020-03-28nix flake info: Show flake subdirectoryEelco Dolstra
2020-03-28flake.nix: Support Nixpkgs 19.09Eelco Dolstra
2020-03-27Add test for circular flake dependenciesEelco Dolstra
2020-03-27Improve lock file generationEelco Dolstra
This is now done in a single pass. Also fixes some issues when updating flakes with circular dependencies. Finally, when using '--recreate-lock-file --commit-lock-file', the commit message now correctly shows the differences.
2020-03-27Fix diffLockFiles()Eelco Dolstra
2020-03-25Merge pull request #3445 from gnprice/pr-installer-colorsEelco Dolstra
installer: Fix terminal colors.
2020-03-24installer: Fix terminal colors.Greg Price
The install-multi-user script uses blue, green, and red colors, as well as bold and underline, to add helpful formatting that helps structure its rather voluminous output. Unfortunately, the terminal escape sequences it uses are not quite well-formed. The relevant information is all there, just obscured by some extra noise, a leading parameter `38`. Empirically, the result is: * On macOS, in both Terminal.app and iTerm2, the spurious `38` is ignored, the rest of the escape sequence is applied, and the colors show up as intended. * On Linux, in at least gnome-terminal and xterm, the spurious `38` and the next parameter after it are ignored, and what's left is applied. So in the sequence `38;4;32`, the 4 (underline) is ignored but the 32 (green) takes effect; in a more typical sequence like `38;34`, the 34 (blue) is ignored and nothing happens. These codes are all unchanged since this script's origins as a Darwin-only script -- so the fact that they work fine in common macOS terminals goes some way to explain how the bug arose. Happily, we can make the colors work as intended by just deleting the extra `38;`. Tested in all four terminals mentioned above; the new codes work correctly on all of them, and on the two macOS terminals they work exactly the same as before. --- In a bit more technical detail -- perhaps more than anyone, me included, ever wanted to know, but now that I've gone and learned it I'll write it down anyway :) -- here's what's happening in these codes: An ECMA-48 "control sequence" begins with `\033[` aka "CSI", contains any number of parameters as semicolon-separated decimal numbers (plus sometimes other wrinkles), and ends with a byte from 0x40..0x7e. In our case, with `m` aka "SGR", "Select Graphic Rendition". An SGR control sequence `\033[...m` sets colors, fonts, text styles, etc. In particular a parameter `31` means red, `32` green, `34` blue, `4` underline, and `0` means reset to normal. Those are all we use. There is also a `38`. This is used for setting colors too... but it needs arguments. `38;5;nn` is color nn from a 256-color palette, and `38;2;rr;gg;bb` has the given RGB values. There is no meaning defined for `38;1` or `38;34` etc. On seeing a parameter `38` followed by an unrecognized argument for it, apparently some implementations (as seen on macOS) discard only the `38` and others (as seen on Linux) discard the argument too before resuming.
2020-03-24Misc changes from the flakes branchEelco Dolstra
2020-03-24Fix --refresh with --no-netEelco Dolstra
https://hydra.nixos.org/build/110879699 (cherry picked from commit 5bbe793abf18414878a069399d1759673d693fb6)
2020-03-24nix: Add --refresh as an alias for --tarball-ttl 0Eelco Dolstra
(cherry picked from commit e721f99817bb7154d8098c902e25f84521a90b7f)
2020-03-24nix path-info --json: Print hash in SRI formatEelco Dolstra
(cherry picked from commit 442e665d6d3fcbdee7dece2f62a597142f8784b1)
2020-03-24Pretty-print 'nix why-depends' / 'nix-store -q --tree' outputEelco Dolstra
Extracted from 678301072f05b650dc15c5edb4c25f08f0d6cace.
2020-03-24absPath(): Use std::optionalEelco Dolstra
(cherry picked from commit 1bf9eb21b75f0d93d9c1633ea2e6fdf840047e79)
2020-03-24buildenv: Eliminate global variables, other cleanupEelco Dolstra
(cherry picked from commit b82f75464d1e5ae9a00d8004e5dd7b1ca05059e4)
2020-03-24Fix coverage buildEelco Dolstra
https://hydra.nixos.org/build/110757285 (cherry picked from commit b430a81a1fbf6c792ba49e3aefe46256263430e5)
2020-03-24nix edit: Support non-derivation attributesEelco Dolstra
E.g. $ nix edit .#nixosConfigurations.bla now works. (cherry picked from commit d2032edb2f86e955a8a7724a27c0c3225f386500)