aboutsummaryrefslogtreecommitdiff
path: root/src/nix
AgeCommit message (Collapse)Author
2022-01-24bundler: pass drv attrset instead of pathTom Bereknyei
2022-01-24hiliteMatches(): Style fixes, pass more stuff by referenceEelco Dolstra
2022-01-24Merge pull request #5945 from afishhh/masterThéophane Hufschmitt
Make `nix search` highlight all regexes and matches
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-21Merge pull request #5942 from NixOS/5912-quieter-nix-why-dependsEelco Dolstra
Make `nix why-depends` quieter by default
2022-01-21Improve the description of the `--precise` optionThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-01-20Make `hilite_all` take an iterator of matches instead of a vector.Hubert Głuchowski
2022-01-19Remove dead field in NixArgsJohn Ericson
This has been unused since 170e86dff5724264e0d3d25b9af1bd42df6aec74 CC @thufschmitt
2022-01-19Make `nix search` highlight all matches of a regexHubert Głuchowski
2022-01-19Make `nix search` highlight all regexesHubert Głuchowski
2022-01-19Make `nix why-depends` quieter by defaultregnat
Unless `--precise` is passed, make `nix why-depends` only show the dependencies between the store paths, without introspecting them to find the actual references. This also makes it ~3x faster
2022-01-18Merge pull request #5918 from tweag/tty-logsEelco Dolstra
Print build logs when not connected to a TTY
2022-01-18Add examplesEelco Dolstra
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
2022-01-18Merge pull request #5932 from edolstra/remove-shared-stringsEelco Dolstra
Remove shared strings
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2022-01-18Merge pull request #5720 from tomberek/flake_searchThéophane Hufschmitt
flakes: search up to git or filesystem boundary
2022-01-18Fix the rendering of the example directory treeregnat
2022-01-17Merge pull request #5812 from pennae/small-perf-improvementsEelco Dolstra
improve parser performance a bit
2022-01-17Update documentation for paths on command lineAlexander Bantyev
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-01-17Show build and substitution information when not connected to a TTYAlexander Bantyev
When stderr is not connected to a tty, show "building" and "substituting" messages, a-la nix-build et al. Closes https://github.com/NixOS/nix/issues/4402 Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-01-14Document searching upwards and fix documentation for installablesAlexander Bantyev
2022-01-14Start the pager early-enough in `nix why-depends`regnat
`nix why-depends` is piping its output into a pager by default. However the pager was only started after the first path is printed, causing it to be excluded from the pager output. (Actually the pager was started *inside* the recursive function that was printing the dependency chain, so a new instance was started at each level. It’s a little miracle that it worked at all). Fix #5911
2022-01-13avoid copies of parser input datapennae
when given a string yacc will copy the entire input to a newly allocated location so that it can add a second terminating NUL byte. since the parser is a very internal thing to EvalState we can ensure that having two terminating NUL bytes is always possible without copying, and have the parser itself merely check that the expected NULs are present. # before Benchmark 1: nix search --offline nixpkgs hello Time (mean ± σ): 572.4 ms ± 2.3 ms [User: 563.4 ms, System: 8.6 ms] Range (min … max): 566.9 ms … 579.1 ms 50 runs Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 381.7 ms ± 1.0 ms [User: 348.3 ms, System: 33.1 ms] Range (min … max): 380.2 ms … 387.7 ms 50 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.936 s ± 0.005 s [User: 2.715 s, System: 0.221 s] Range (min … max): 2.923 s … 2.946 s 50 runs # after Benchmark 1: nix search --offline nixpkgs hello Time (mean ± σ): 571.7 ms ± 2.4 ms [User: 563.3 ms, System: 8.0 ms] Range (min … max): 566.7 ms … 579.7 ms 50 runs Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 376.6 ms ± 1.0 ms [User: 345.8 ms, System: 30.5 ms] Range (min … max): 374.5 ms … 379.1 ms 50 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.922 s ± 0.006 s [User: 2.707 s, System: 0.215 s] Range (min … max): 2.906 s … 2.934 s 50 runs
2022-01-04Ensure that attrsets are sortedEelco Dolstra
Previously you had to remember to call value->attrs->sort() after populating value->attrs. Now there is a BindingsBuilder helper that wraps Bindings and ensures that sort() is called before you can use it.
2021-12-29Add ability to toggle show-trace from within the replAlexander Bantyev
2021-12-27Fix accidental O(n^2 * log n) performance in NixRepl::addAttrsToScopeYorick van Pelt
Only sort once, after adding all of the attrs first. This reduces my `nix repl '<nixpkgs>'` loading time from 1.07s to 103ms. Fixes #5823
2021-12-22Merge pull request #5821 from edolstra/remove-affinityEelco Dolstra
Remove CPU locking
2021-12-22Merge pull request #5820 from ncfavier/completion-nospaceEelco Dolstra
Don't insert spaces when completing attribute paths
2021-12-22Don't insert spaces when completing attribute pathsNaïm Favier
2021-12-22Remove CPU lockingEelco Dolstra
This was already accidentally disabled in ba87b08. It also no longer appears to be beneficial, and in fact slow things down, e.g. when evaluating a NixOS system configuration: elapsed time: median = 3.8170 mean = 3.8202 stddev = 0.0195 min = 3.7894 max = 3.8600 [rejected, p=0.00000, Δ=0.36929±0.02513]
2021-12-20Add shell completion for why-dependsNaïm Favier
Fixes #5806
2021-12-15Fix typo in `src/nix/shell.md`Noah Snelson
Changed `If not command` to `If no command`, also specified that the default shell launched in `nix shell` can be specified with `$SHELL`.
2021-12-13nix run: Tweak docsEelco Dolstra
2021-12-13Merge branch 'pname-main-program' of https://github.com/figsoda/nixEelco Dolstra
2021-12-09Properly take the last assignment in the REPLregnat
When a variable is assigned in the REPL, make sure to remove any possible reference to the old one so that we correctly pick the new one afterwards Fix #5706
2021-12-06nix repl: add :logAlexander Bantyev
Add a :log command that shows logs for a derivation. Closes https://github.com/NixOS/nix/issues/3504 Co-authored-by: Taeer Bar-Yam <taeer@bar-yam.me>
2021-11-27Fix typoAleksey Kladov
2021-11-26nix repl: Reset the terminal on exceptional exitsEelco Dolstra
2021-11-26Catch flake-related exception type in REPLAlex Shabalin
Closes https://github.com/NixOS/nix/issues/5656
2021-11-25Support range-based for loop over list valuesEelco Dolstra
2021-11-24nix flake check: Fix markdownEelco Dolstra
2021-11-18Fix :e in replAlex Shabalin
Closes https://github.com/NixOS/nix/issues/5487 Co-authored-by: Alexander Bantyev balsoft@balsoft.ru
2021-11-16Ignore errors unsharing/restoring the mount namespaceEelco Dolstra
This prevents Nix from barfing when run in a container where it doesn't have the appropriate privileges.
2021-11-15Merge pull request #5428 from kreisys/add-pos-to-json-type-errorDomen Kožar
toJSON: report error position for fancier output
2021-11-12Merge pull request #5540 from samueldr/fix/key-subcommandEelco Dolstra
nix key: Fix error message and don't require flakes
2021-11-12nix registry: Mark experimentalSamuel Dionne-Riel
This is part of the flakes feature. Mark it as such.
2021-11-11nix key: Fix error message and don't require flakesSamuel Dionne-Riel