aboutsummaryrefslogtreecommitdiff
path: root/src/nix/develop.cc
AgeCommit message (Collapse)Author
2021-07-09nix print-dev-env: Add --json flagEelco Dolstra
2021-07-09nix develop: Filter some bash magic variablesEelco Dolstra
2021-07-09nix develop: Don't parse bash environment with regexesEelco Dolstra
Instead have get-env.sh dump the bash environment as JSON. This should be a lot less error-prone. Fixes #4992.
2021-07-05Fix devShell handling of env values including @ and %Michael Fellinger
2021-06-29develop: Discard the input{Overrides,Updates} when getting bashregnat
`nix develop` is getting bash from an (assumed existing) `nixpkgs` flake. However, when doing so, it reuses the `lockFlags` passed to the current flake, including the `--input-overrides` and `--input-update` which generally don’t make sense anymore at that point (and trigger a warning because of that) Clear these overrides before getting the nixpkgs flake to get rid of the warning.
2021-06-23Merge pull request #4908 from NixOS/ca/fix-nix-developEelco Dolstra
Make `nix develop` work with CA derivations
2021-06-22Add testcase for `nix develop` with `__structuredAttrs`Maximilian Bosch
2021-06-22Fix usage of structured attrs for `nix develop`Maximilian Bosch
2021-06-21Properly set the output env variablesThéophane Hufschmitt
Co-authored-by: John Ericson <git@JohnEricson.me>
2021-06-15nix develop: Filter out NIX_REMOTEEelco Dolstra
When recursive Nix is enabled, NIX_REMOTE is set to unix:///build/.nix-socket, which doesn't work outside of the sandbox.
2021-06-11Make `nix develop` work with CA derivationsregnat
Fix #4823
2021-05-17Source bashrc first in nix developMatthew Bauer
~/.bashrc should be sourced first in the rc script so that PATH & other env vars give precedence over the bashrc PATH. Also, in my bashrc I alias rm as: alias rm='rm -Iv' To avoid running this alias (which shows ‘removed '/tmp/nix-shell.*'), we can just prefix rm with command.
2021-05-17Enfore the use of properly built paths in libcmdregnat
Replace `DerivedPathWithHints` by a new `BuiltPath` type that serves as a proof that the corresponding path has been built.
2021-05-12DerivedPathWithHints -> BuiltPathregnat
Just a renaming for now
2021-04-07restoreSignals() + restoreAffinity() -> restoreProcessContext()Eelco Dolstra
2021-04-05Make `DerivedPathWithHints` a newtypeJohn Ericson
This allows us to namespace its constructors under it.
2021-04-05Rename BuildableJohn Ericson
2021-04-05Use `BuildableReq` for `buildPaths` and `ensurePath`John Ericson
This avoids an ambiguity where the `StorePathWithOutputs { drvPath, {} }` could mean "build `brvPath`" or "substitute `drvPath`" depending on context. It also brings the internals closer in line to the new CLI, by generalizing the `Buildable` type is used there and makes that distinction already. In doing so, relegate `StorePathWithOutputs` to being a type just for backwards compatibility (CLI and RPC).
2021-02-17Throw an error if --arg / --argstr is used with a flakeEelco Dolstra
Fixes #3949.
2021-02-17nix develop: Fix quoted string handlingEelco Dolstra
Fixes #4540.
2021-01-29Shorten `mktemp` flag for macOSJames Ottaway
Address `mktemp: illegal option -- -`.
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2020-12-21Add 'nix develop' and `nix print-dev-env' manpagesEelco Dolstra
2020-11-09nix develop: Preserve stdin with `-c`Sebastian Ullrich
2020-10-26Make the prompt used in development shells configurableEelco Dolstra
2020-10-22Fix clang buildEelco Dolstra
2020-10-22nix develop: Add --redirect flag to redirect dependenciesEelco Dolstra
This is primarily useful if you're hacking simultaneously on a package and one of its dependencies. E.g. if you're hacking on Hydra and Nix, you would start a dev shell for Nix, and then a dev shell for Hydra as follows: $ nix develop \ --redirect .#hydraJobs.build.x86_64-linux.nix ~/Dev/nix/outputs/out \ --redirect .#hydraJobs.build.x86_64-linux.nix.dev ~/Dev/nix/outputs/dev (This assumes hydraJobs.build.x86_64-linux has a passthru.nix attribute. You can also use a store path.) This causes all references in the environment to those store paths to be rewritten to ~/Dev/nix/outputs/{out,dev}. Note: unfortunately, you may need to set LD_LIBRARY_PATH=~/Dev/nix/outputs/out/lib because Nixpkgs' ld-wrapper only adds -rpath entries for -L flags that point to the Nix store.
2020-10-21nix develop: Handle 'declare -ax' in bash outputEelco Dolstra
Fixes 'nix develop nixpkgs#qpdfview'.
2020-10-20Make bash non-interactive for nix develop --phaseMatthew Kenigsberg
Fix #3975: Currently if Ctrl-C is pressed during a phase, the interactive subshell is not exited. Removing --rcfile when --phase is present makes bash non-interactive
2020-10-09nix develop: Unset $HOSTNAMEEelco Dolstra
This is set to "localhost" by stdenv which is probably not what you want.
2020-10-09nix develop: Source ~/.bashrcEelco Dolstra
Fixes #4104.
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-16Make the store plugins more introspectableregnat
Directly register the store classes rather than a function to build an instance of them. This gives the possibility to introspect static members of the class or choose different ways of instantiating them.
2020-08-28Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-28nix develop: Add convenience flags for running specific phasesEelco Dolstra
For example, for building the Nix flake, you would do: $ nix develop --configure $ nix develop --install $ nix develop --installcheck
2020-08-28nix develop: Set output paths to writable locationsEelco Dolstra
Currently, they're set to $(pwd)/outputs/$outputName. This allows commands like 'make install' to work.
2020-08-23`writeDerivation` just needs a plain store referenceJohn Ericson
2020-08-19fix spellingRyan Mulligan
2020-08-10Remove name parameter from `writeDerivation`John Ericson
The name is now stored with the derivation itself.
2020-08-05Merge remote-tracking branch 'upstream/master' into misc-caJohn Ericson
2020-07-29Set regex_constants::match_continuous for quicker searchMatthew Bauer
match_continuous limits the search to the current start position, instead of searching the entire file. On libc++, this improves performance dramatically: $ time /nix/store/70ai68dfm6xbzwn26j5n4li9di52ylia-nix-3.0pre20200728_c159f48/bin/nix print-dev-env >/dev/null /nix/store/70ai68dfm6xbzwn26j5n4li9di52ylia-nix-3.0pre20200728_c159f48/bin/ni 2.39s user 0.19s system 64% cpu 4.032 total $ time /nix/store/cwjfxxlp83zln4mfyy1d2dbsx7f6s962-nix-3.0pre20200728_dirty/bin/nix print-dev-env >/dev/null /nix/store/cwjfxxlp83zln4mfyy1d2dbsx7f6s962-nix-3.0pre20200728_dirty/bin/nix 0.09s user 0.05s system 65% cpu 0.204 total Fixes #3874
2020-07-17Merge branch 'multi-output-hashDerivationModulo' of ↵Carlo Nucera
github.com:Ericson2314/nix into misc-ca
2020-07-16Merge branch 'master' of github.com:NixOS/nix into ↵Carlo Nucera
optional-derivation-output-storepath
2020-07-15nix: Add --derivation flag to operate on .drv pathsEelco Dolstra
For instance, 'nix why-depends --use-derivation nixpkgs#hello nixpkgs#glibc' shows why hello's .drv depends on glibc's .drv.
2020-07-15Clean up RealiseModeEelco Dolstra
2020-07-12DerivationOutputExtensional -> DerivationOutputInputAddressedJohn Ericson
Thanks @regnat for the great name.
2020-07-09Fix DerivationOutputExtensional nameMatthew Bauer
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-06nix develop: Support derivations with multiple outputsEelco Dolstra
2020-07-06nix develop: Fall back to "bash" if nixpkgs#bashInteractive is unavailableEelco Dolstra