aboutsummaryrefslogtreecommitdiff
path: root/src/nix/search.cc
AgeCommit message (Collapse)Author
2022-04-14Make InstallableFlake::toValue() and toDerivation() behave consistentlyEelco Dolstra
In particular, this means that 'nix eval` (which uses toValue()) no longer auto-calls functions or functors (because AttrCursor::findAlongAttrPath() doesn't). Fixes #6152. Also use ref<> in a few places, and don't return attrpaths from getCursor() because cursors already have a getAttrPath() method.
2022-01-24hiliteMatches(): Style fixes, pass more stuff by referenceEelco Dolstra
2022-01-21Move hilite_all into libutil and rename it to hiliteMatchesFishhh
The signature was also changed so the function now accepts a vector instead of an iterator
2022-01-20Make `hilite_all` take an iterator of matches instead of a vector.Hubert Głuchowski
2022-01-19Make `nix search` highlight all matches of a regexHubert Głuchowski
2022-01-19Make `nix search` highlight all regexesHubert Głuchowski
2021-09-22Disable IFD selectivelyEelco Dolstra
It's now disabled by default for the following: * 'nix search' (this was already implied by read-only mode) * 'nix flake show' * 'nix flake check', but only on the hydraJobs output
2021-02-03Always enter first level of attrset in nix searchMatthew Bauer
This makes nix search always go through the first level of an attribute set, even if it's not a top level attribute. For instance, you can now list all GHC compilers with: $ nix search nixpkgs#haskell.compiler ... This is similar to how nix-env works when you pass in -A.
2020-12-21Add 'nix search' manpageEelco Dolstra
2020-10-09Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-10-06Remove static variable name clashesEelco Dolstra
This was useful for an experiment with building Nix as a single compilation unit. It's not very useful otherwise but also doesn't hurt...
2020-09-25stdout_ -> coutJohn Ericson
Better to get creative than just sprinkle arbitrary underscores.
2020-09-04Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-08-07Make --no-eval-cache a global settingEelco Dolstra
2020-07-30Merge remote-tracking branch 'origin/master' into fix-and-ci-static-buildsMatthew Bauer
2020-06-04nix flake init: Add a '--template' flagEelco Dolstra
The initial contents of the flake is specified by the 'templates.<name>' or 'defaultTemplate' output of another flake. E.g. outputs = { self }: { templates = { nixos-container = { path = ./nixos-container; description = "An example of a NixOS container"; }; }; }; allows $ nix flake init -t templates#nixos-container Also add a command 'nix flake new', which is identical to 'nix flake init' except that it initializes a specified directory rather than the current directory.
2020-05-07Update src/nix/search.ccEelco Dolstra
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2020-05-06nix/search: no error for empty search results if json is enabledJörg Thalheim
- result list will be always empty if --json is passed - for scripts an empty search result is not really an error, we rather want to distinguish between evaluation errors and empty results
2020-05-04Flag: Use designated initializersEelco Dolstra
2020-04-27nix search: Search legacyPackages recursivelyEelco Dolstra
2020-04-24nix search: Show versionEelco Dolstra
2020-04-20Revive 'nix search'Eelco Dolstra
It uses the evaluation cache now rather than the ad hoc JSON cache.
2020-04-16Add 'nix flake show' commandEelco Dolstra
2019-12-05Make subcommand construction in MultiCommand lazyEelco Dolstra
(cherry picked from commit a0de58f471c9087d8e6cc60a6078f9940a125b15)
2019-10-10Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-10-09nix search: Don't quietly ignore errorsEelco Dolstra
2019-10-07nix search: remove verbose exampleSam Doshi
2019-06-18Make subcommand construction in MultiCommand lazyEelco Dolstra
2019-04-08nix: Make -f work for compatibilityEelco Dolstra
2018-07-27search: include versionWill Dietz
2018-07-02search.cc: improve UX for `nix search`Maximilian Bosch
As proposed in #1634 the `nix search` command could use some improvements. Initially 0413aeb35d6ee869a98b6565781c1cf47dc80080 added some basic sorting behavior using `std::map`, a next step would be an improvement of the output. This patch includes the following changes: * Use `$PAGER` for outputs with `RunPager` from `shared.hh`: The same behavior is defined for `nix-env --query`, furthermore it makes searching huge results way easier. * Simplified result blocks: The new output is heavily inspired by the output from `nox`, the first line shows the attribute path and the derivaiton name (`attribute path (derivation name)`) and the description in the second line.
2018-04-18Allow multiple search experssions in nix searchDaniel Poelzleithner
The common use case is to search for packages containing multiple words like a "git" "frontend". Having only one expressions makes this simple regular use case very complicated. Instead, search accepts multiple regular epressions which all need to match. nix search git 'gui|frontend' returns a list of all git uis for example
2018-03-13Merge pull request #1906 from dtzWill/fix/nix-searchShea Levy
nix search: tests and fix #1893 and part of #1892
2018-02-25nix search: explicitly handle empty search string, fixes #1893Will Dietz
This is important since this is given as an example. Other patterns containing "empty search string" will still be handled differently on different platforms ("asdf|") but that's less of an issue.
2018-02-25nix search: fix bug where we wrote to cache when shouldn't, breakingWill Dietz
This is exposed by the tests added previously, and resolves the error reported in #1892: "expected JSON value".
2017-12-12search.cc: sort attribute names with `std::map`Maximilian Bosch
2017-12-04Fix #1635.Eelco Dolstra
2017-11-14Don't indent JSON outputEelco Dolstra
2017-10-24nix: Respect -I, --arg, --argstrEelco Dolstra
Also, random cleanup to argument handling.
2017-09-07nix search: Add examplesEelco Dolstra
2017-08-29nix search: Warn about cached resultsEelco Dolstra
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-26nix search: Add a cacheEelco Dolstra
The package list is now cached in ~/.cache/nix/package-search.json. This gives a substantial speedup to "nix search" queries. For example (on an SSD): First run: (no package search cache, cold page cache) $ time nix search blender Attribute name: nixpkgs.blender Package name: blender Version: 2.78c Description: 3D Creation/Animation/Publishing System real 0m6.516s Second run: (package search cache populated) $ time nix search blender Attribute name: nixpkgs.blender Package name: blender Version: 2.78c Description: 3D Creation/Animation/Publishing System real 0m0.143s
2017-07-20nix search: Ignore top-level eval errorsEelco Dolstra
$NIX_PATH may contain elements that don't evaluate to an attrset (like "nixos-config"), so ignore those.
2017-07-20nix search: Add --json flagEelco Dolstra
2017-07-20Add "nix search" commandEelco Dolstra