aboutsummaryrefslogtreecommitdiff
path: root/src/nix/repl.cc
AgeCommit message (Collapse)Author
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-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-18Fix :e in replAlex Shabalin
Closes https://github.com/NixOS/nix/issues/5487 Co-authored-by: Alexander Bantyev balsoft@balsoft.ru
2021-11-05Merge pull request #5476 from NixOS/ca/fix-build-in-nix-replThéophane Hufschmitt
Fix `nix repl`’s building of CA derivations
2021-11-05Fix `nix repl`’s building of CA derivationsregnat
When running a `:b` command in the repl, after building the derivations query the store for its outputs rather than just assuming that they are known in the derivation itself (which isn’t true for CA derivations) Fix #5328
2021-11-04StaticEnv: Use std::vector instead of std::mapEelco Dolstra
2021-10-12Merge pull request #5375 from edolstra/repl-ctrl-cEelco Dolstra
nix repl: Fix plugin-files warning
2021-10-12nix repl: Don't write to std::cout directlyEelco Dolstra
Writing to std::cout doesn't play nice with ProgressBar.
2021-10-12nix repl: Don't build in a child processEelco Dolstra
Fixes #5356. This is a bit risky due to interrupts, but we have to deal with those anyway (#5353).
2021-10-07nix repl: properly deal with interruptionsMaximilian Bosch
When I stop a download with Ctrl-C in a `nix repl` of a flake, the REPL refuses to do any other downloads: nix-repl> builtins.getFlake "nix-serve" [0.0 MiB DL] downloading 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca41 error: download of 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca416e5a9415d4972b0f0' was interrupted [0.0 MiB DL] nix-repl> builtins.getFlake "nix-serve" error: interrupted by the user [0.0 MiB DL] To fix this issue, two changes were necessary: * Reset the global `_isInterrupted` variable: only because a single operation was aborted, it should still be possible to continue the session. * Recreate a `fileTransfer`-instance if the current one was shut down by an abort.
2021-09-14ANSI_YELLOW -> ANSI_WARNINGEelco Dolstra
2021-09-14Fix macOS buildEelco Dolstra
2021-09-13RunOptions: Use designated initializersEelco Dolstra
Also get rid of _killStderr because it wasn't actually checked anywhere.
2021-07-20Merge remote-tracking branch 'origin/repl-flake-support'Eelco Dolstra
2021-07-19nix repl: Update :edit help textRobert Hensing
It supports functions as well. Also change `package` to `derivation` because it operates at the language level and does not open the derivation (which would be useful but not nearly as much).
2021-07-19Rename findDerivationFilename -> findPackageFilenameRobert Hensing
It does not operate on a derivation and does not return a derivation path. Instead it works at the language level, where a distinct term "package" is more appropriate to distinguish the parent object of `meta.position`; an attribute which doesn't even make it into the derivation.
2021-07-19Add a `:load-flake` command to the nix replregnat
`:lf ref` does essentially the same thing as `:a (builtins.getFlake "ref")` (but cannonicalising `ref` if needs be, so that `:lf .` works) Fix #3803
2021-07-16Forward the whole Nix config to the repl subprocessesregnat
Fill `NIX_CONFIG` with the value of the current Nix configuration before calling the nix subprocesses in the repl That way the whole configuration (including the possible `experimental-features`, a possibly `--store` option or whatever) will be made available. This is required for example to make `nix repl` work with a custom `--store`
2021-06-29Forward the experimental features to the nix repl subprocessesregnat
Pass the current experimental features using `NIX_CONFIG` to the various Nix subprocesses that `nix repl` invokes. This is quite a hack, but having `nix repl` call Nix with a subprocess is a hack already, so I guess that’s fine.
2021-04-07restoreSignals() + restoreAffinity() -> restoreProcessContext()Eelco Dolstra
2020-12-21Add 'nix repl' manpageEelco Dolstra
2020-12-18Replace Value type setters with mk* functionsSilvan Mosberger
Move clearValue inside Value mkInt instead of setInt mkBool instead of setBool mkString instead of setString mkPath instead of setPath mkNull instead of setNull mkAttrs instead of setAttrs mkList instead of setList* mkThunk instead of setThunk mkApp instead of setApp mkLambda instead of setLambda mkBlackhole instead of setBlackhole mkPrimOp instead of setPrimOp mkPrimOpApp instead of setPrimOpApp mkExternal instead of setExternal mkFloat instead of setFloat Add note that the static mk* function should be removed eventually
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-12Add ValueType checking functions for types that have the same NormalTypeSilvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger
2020-12-12Introduce Value type setters and make use of themSilvan Mosberger
2020-11-02nix repl: Fix handling of multi-line expressionsEelco Dolstra
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-01Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-31Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-08-28Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-25Add getDoc() functionEelco Dolstra
2020-08-24nix repl ':doc': Render using lowdownEelco Dolstra
2020-08-24Allow primops to have Markdown documentationEelco Dolstra
2020-08-20Rename drv output querying functions, like masterJohn Ericson
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap` - `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap
2020-08-20Allow 'nix' subcommands to provide docs in Markdown formatEelco Dolstra
2020-08-18Merge remote-tracking branch 'upstream/master' into ↵John Ericson
derivation-header-include-order
2020-08-14Merge pull request #3875 from obsidiansystems/new-interface-for-path-pathOptEelco Dolstra
Offer a safer interface for path and pathOpt
2020-08-07Squashed get CA derivations buildingJohn Ericson
2020-08-06repl.cc: Check for HAVE_BOEHMGCEelco Dolstra
Fixes #3906.
2020-08-01Merge remote-tracking branch 'upstream/master' into ↵John Ericson
derivation-header-include-order
2020-07-28Use the new interfaceCarlo Nucera
2020-07-16Merge branch 'master' of github.com:NixOS/nix into ↵Carlo Nucera
optional-derivation-output-storepath
2020-07-12String .drv suffix to create derivation nameJohn Ericson
2020-07-08Only store hash of fixed derivation outputMatthew Bauer
we don’t need a full storepath for a fixedoutput derivation. So just putting the ingestion method + the hash is sufficient.
2020-07-08Add name to BasicDerivationMatthew Bauer
We always have a name for BasicDerivation, since we have a derivation store path that has a name.
2020-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra