aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-04-03nix-env: Refuse to operate on a new-style profileEelco Dolstra
This prevents users from accidentally nuking their profile via nix-env. (cherry picked from commit 021634e3e3edb327089d33ab41b743f0a40126da)
2020-04-02libexpr: remove unused attrErrorAndreas Rammhold
The attrError variable is no longer used but still allocated on every call to the findAlongAttrPath function.
2020-04-02Make function arguments retain position infoSilvan Mosberger
This allows querying the location of function arguments. E.g. builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null)) => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
2020-03-31Merge pull request #3460 from NixOS/dev-shellEelco Dolstra
Backport 'nix dev-shell' from the flakes branch
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-30Remove global -I flagsEelco Dolstra
(cherry picked from commit 2c692a3b144523bca68dd6de618124ba6c9bb332)
2020-03-30fetchGit: don't use std::filesystem to filter git reposJulian Stecklina
Using std::filesystem means also having to link with -lstdc++fs on some platforms and it's hard to discover for what platforms this is needed. As all the functionality is already implemented as utilities, use those instead.
2020-03-29fetchGit: fix submodule corner case by fetching all refs from cacheDirBjørn Forsman
Due to fetchGit not checking if rev is an ancestor of ref (there is even a FIXME comment about it in the code), the cache repo might not have the ref even though it has the rev. This doesn't matter when submodule = false, but the submodule = true code blows up because it tries to fetch the (missing) ref from the cache repo. Fix this in the simplest way possible: fetch all refs from the local cache repo when submodules = true. TODO: Add tests.
2020-03-29fetchGit: fix submodules = true for dirty treesBjørn Forsman
2020-03-29fetchGit: checkout rev instead of latest refBjørn Forsman
Major bugfix for the submodules = true code path. TODO: Add tests.
2020-03-29fetchGit: add submodules attribute to the .link fileBjørn Forsman
The .link file is used as a lock, so I think we should put the "submodule" attribute in there since turning on submodules creates a new .link file path.
2020-03-29fetchGit: fix submodule output attributeBjørn Forsman
Before this change it would be false for all evaluations but the first. Now it follows the input argument (as it should).
2020-03-29fetchGit: fix "fatal: couldn't find remote ref refs/heads/master" issue with ↵Bjørn Forsman
submodules
2020-03-29Link to stdc++fsJulian Stecklina
Some platforms seem to still require linking with stdc++fs to enable STL std::filesystem support.
2020-03-29Rename fetchGit fetchSubmodules to just submodulesJulian Stecklina
2020-03-29Add git submodule fixes from @bjornforJulian Stecklina
This fixes fetching repositories with no submodules and also cleans up .git files in checkouts.
2020-03-29Add fetchSubmodules to builtins.fetchGitJulian Stecklina
There are some downsides to this features: - Submodules are not cached (unlike the root repo), - Full checkouts are created in a temporary directory.
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)
2020-03-24findAlongAttrPath(): Return positionEelco Dolstra
(cherry picked from commit 0b013a54dc570395bed887369f8dd622b8ce337b)
2020-03-24findAlongAttrPath(): Throw AttrPathNotFoundEelco Dolstra
(cherry picked from commit 6b0ca8e803710342af70e257935724c5ad84ca04)
2020-03-24Add function for quoting stringsEelco Dolstra
(cherry picked from commit 7dcf5b011a0942ecf953f2b607c4c8d0e9e652c7)
2020-03-24Use std::string_viewEelco Dolstra
(cherry picked from commit 6529490cc10018d5191e50c482ac1180b96b1a3c)
2020-03-24EvalState::allocAttr(): Add convenience methodEelco Dolstra
(cherry picked from commit c02da997570ac0d9b595d787bea8cb5a4e3cc1f5)
2020-03-23Merge pull request #3429 from LnL7/darwin-sandboxEelco Dolstra
darwin sandbox
2020-03-20sandbox: fix /bin/sh on catalinaDaiderd Jordan
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it can't be used anymore without also opening up the sandbox to allow bash. Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).
2020-03-20sandbox: allow pty devicesDaiderd Jordan
Nix now runs builds with a pseudo-terminal to enable colored build output.
2020-03-20libstore: relax default sandbox-paths on darwinDaiderd Jordan
2020-03-20libstore: disable resolve-system-dependencies hookDaiderd Jordan
This is used to determine the dependency tree of impure libraries so nix knows what paths to open in the sandbox. With the less restrictive defaults it isn't needed anymore.
2020-03-19Remove the --delete option for --gcjakobrs
Running `nix-store --gc --delete` will, as of Nix 2.3.3, simply fail because the --delete option conflicts with the --delete operation. $ nix-store --gc --delete error: only one operation may be specified Try 'nix-store --help' for more information. Furthermore, it has been broken since at least Nix 0.16 (which was released sometime in 2010), which means that any scripts which depend on it should have been broken at least nine years ago. This commit simply formally removes the option. There should be no actual difference in behaviour as far as the user is concerned: it errors with the exact same error message. The manual has been edited to remove any references to the (now gone) --delete option. Other information: * Path for Nix 0.16 used: /nix/store/rp3sgmskn0p0pj1ia2qwd5al6f6pinz4-nix-0.16
2020-03-19nix repl: Put EvalState on the heapEelco Dolstra
See 0629601da1d163a059fa19004256961f8ecdeb78.
2020-03-19nix repl: Scan NixRepl for GC rootsEelco Dolstra
Fixes #3175.
2020-03-13Add missing `#include <regex>`John Ericson
2020-03-13Merge pull request #3380 from contrun/no-attr-path-for-installedEelco Dolstra
display attr-path only when queried available
2020-03-14display attr-path only when queried availableYI
2020-03-13Fix ca-references feature checkEelco Dolstra
Fixes #3406.
2020-03-12Merge pull request #3403 from hercules-ci/issue-3398-path-info-cache-ttlsEelco Dolstra
pathInfoCache: Respect disk cache TTLs #3398
2020-03-12pathInfoCache: Respect disk cache TTLs #3398Robert Hensing
2020-03-12local.mk: fix user-env.cc dep on buildenv.nix.gen.hh, resolve occasional ↵Will Dietz
build failure
2020-03-11Move some corepkgs into the nix binaryEelco Dolstra