aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
AgeCommit message (Collapse)Author
2022-03-28nix profile install: Don't use queryDerivationOutputMap()Eelco Dolstra
Instead get the outputs from Installable::build(). This will also allow 'nix profile install' to support impure derivations. Fixes #6286.
2022-03-22nix edit: support kakouneHideaki Kawai
2022-03-16nix: allow using --file - to read from stdinArtturin
2022-03-09BuildResult: Use DerivedPathEelco Dolstra
2022-03-08Add Store::buildPathsWithResults()Eelco Dolstra
This function is like buildPaths(), except that it returns a vector of BuildResults containing the exact statuses and output paths of each derivation / substitution. This is convenient for functions like Installable::build(), because they then don't need to do another series of calls to get the outputs of CA derivations. It's also a precondition to impure derivations, where we *can't* query the output of those derivations since they're not stored in the Nix database. Note that PathSubstitutionGoal can now also return a BuildStatus.
2022-03-07Also display suggestions for the commands using the eval cacheregnat
Make `nix build .#nix-armv8l-linux` work for example
2022-03-07Implement a suggestions mechanismregnat
Each `Error` class now includes a set of suggestions, and these are printed by the top-level handler.
2022-03-02Add EvalState::coerceToStorePath() helperEelco Dolstra
This is useful whenever we want to evaluate something to a store path (e.g. in get-drvs.cc). Extracted from the lazy-trees branch (where we can require that a store path must come from a store source tree accessor).
2022-03-02nix profile: Support CA derivationsEelco Dolstra
2022-03-02Move installables-related operationsEelco Dolstra
2022-02-22Replace defaultBla.$system with bla.$system.defaultEelco Dolstra
This also simplifies some InstallableFlake logic and fixes 'nix bundle' parsing its installable twice. Fixes #5532.
2022-02-14InstallableFlake: Default attr paths cleanupEelco Dolstra
This removes some duplicated logic, and fixes "nix bundle" parsing its installable twice.
2022-02-11parseInstallables(): Don't try the flake attr path prefixes when no fragment ↵Eelco Dolstra
is specified Fixes #5880.
2022-02-03Allow missing flake.nix for --override-input targetMatthew Bauer
At this point, we don’t know if the input is a flake or not. So, we should allow the user to override the input with a directory without a flake.nix. Ideally, we could figure whether the input was originally a flake or not, but that would require instantiating the whole flake. So just allow it to be missing here, and rely on checks later on to verify the input for us.
2022-02-04Make most calls to determinePos() lazyEelco Dolstra
2022-02-04Merge branch 'issue-3505' of https://github.com/kamadorueda/nixEelco Dolstra
2022-01-30use LOWDOWN_LIBS variableThomas Koch
fixes: #5931
2022-01-21forceAttrs: make pos mandatoryKevin Amado
2022-01-21forceValue: make pos mandatoryKevin Amado
- Make passing the position to `forceValue` mandatory, this way we remember people that the position is important for better error messages - Add pos to all `forceValue` calls
2022-01-18Add Installable::toDrvPaths()Eelco Dolstra
This is needed to get the path of a derivation that might not exist (e.g. for 'nix store copy-log'). InstallableStorePath::toDerivedPaths() cannot be used for this because it calls readDerivation(), so it fails if the store doesn't have the derivation.
2022-01-18Add command 'nix store copy-log'Eelco Dolstra
Fixes #5222.
2022-01-18Factor out --from / --to logicEelco Dolstra
2021-12-22Fix attr path completion after a dotNaïm Favier
2021-12-22Don't insert spaces when completing attribute pathsNaïm Favier
2021-12-11EvalCommand::getEvalState: use gc tracable allocator for EvalStateYorick van Pelt
2021-11-26Don’t try to complete flakes is the feature isn’t enabledregnat
Fix #5661
2021-10-26Make experimental-features a proper typeregnat
Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it.
2021-09-30`std::visit` by referenceJohn Ericson
I had started the trend of doing `std::visit` by value (because a type error once mislead me into thinking that was the only form that existed). While the optomizer in principle should be able to deal with extra coppying or extra indirection once the lambdas inlined, sticking with by reference is the conventional default. I hope this might even improve performance.
2021-09-27nix path-info -r: Don't duplicate the root pathsEelco Dolstra
This fixes $ nix path-info -r $(type -P ls) /nix/store/vfilzcp8a467w3p0mp54ybq6bdzb8w49-coreutils-8.32 /nix/store/5d821pjgzb90lw4zbg6xwxs7llm335wr-libunistring-0.9.10 ... /nix/store/mrv4y369nw6hg4pw8d9p9bfdxj9pjw0x-acl-2.3.0 /nix/store/vfilzcp8a467w3p0mp54ybq6bdzb8w49-coreutils-8.32 Also, output the paths in topologically sorted order like we used to.
2021-09-27run(): MoveEelco Dolstra
2021-09-24Use latest lowdownEelco Dolstra
This improves list rendering (https://github.com/kristapsdz/lowdown/issues/73).
2021-09-14Respect NO_COLOR in Markdown outputEelco Dolstra
2021-09-13renderMarkdownToTerminal(): Fix terminal width computationEelco Dolstra
2021-09-10Make installables constEelco Dolstra
2021-09-02Add FIXMEEelco Dolstra
2021-09-02Don't use read-only mode for nix build --dry-runGeorges Dubus
In dry run mode, new derivations can't be create, so running the command on anything that has not been evaluated before results in an error message of the form `don't know how to build these paths (may be caused by read-only store access)`. For comparison, the classical `nix-build --dry-run` doesn't use read-only mode. Closes #1795 (cherry picked from commit 54525682df707742e58311c32e9c9cb18de1e31f)
2021-09-02parseInstallables(): Parse store paths as store pathsEelco Dolstra
If the store path contains a flake, this means that a command like "nix path-info /path" will show info about /path, not about the default output of the flake in /path. If you want the latter, you can explicitly ask for it by doing "nix path-info path:/path". Fixes #4568.
2021-08-30Merge pull request #5175 from Pamplemousse/makeEelco Dolstra
Don't overwrite user provided `lib*_LDFLAGS`
2021-08-25Don't overwrite user provided `lib*_LDFLAGS`Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-16Merge pull request #5134 from pszubiak/fix-pkgconfig-install-pathEelco Dolstra
Install pkg-config files in the correct location
2021-08-14fix typo in ca-error messageJörg Thalheim
2021-08-13Install pkg-config files in the correct locationPiotr Szubiakowski
Use `$(libdir)` while installing .pc files looks like a more generic solution. For example, it will work for distributions like RHEL or Fedora where .pc files are installed in `/usr/lib64/pkgconfig`.
2021-07-28Merge pull request #5042 from alyssais/pthreadEelco Dolstra
Enable pthreads for new libraries
2021-07-24Enable pthreads for new librariesAlyssa Ross
Otherwise the lack of pthread causes linking to fail for NetBSD.
2021-07-22buildPaths(): Add an evalStore argumentEelco Dolstra
With this, we don't have to copy the entire .drv closure to the destination store ahead of time (or at all). Instead, buildPaths() reads .drv files from the eval store and copies inputSrcs to the destination store if it needs to build a derivation. Issue #5025.
2021-07-22Use eval-store in more placesEelco Dolstra
In particular, this now works: $ nix path-info --eval-store auto --store https://cache.nixos.org nixpkgs#hello Previously this would fail as it would try to upload the hello .drv to cache.nixos.org. Now the .drv is instantiated in the local store, and then we check for the existence of the outputs in cache.nixos.org.
2021-07-22nix-build: Copy drv closure between eval store and build storeEelco Dolstra
2021-07-22Support --eval-store in nix-instantiate and nix-buildEelco Dolstra
2021-07-22Hacky fast closure copying mechanismEelco Dolstra
2021-07-22Add --eval-store optionEelco Dolstra