aboutsummaryrefslogtreecommitdiff
path: root/src/nix/develop.cc
AgeCommit message (Collapse)Author
2021-10-09nix develop: add --unpackArtturin
2021-09-08Merge branch 'fix-3976' of https://github.com/mkenigs/nixEelco Dolstra
2021-08-21nix develop: Fix `devShells` lookupJan Tojnar
It currently fails with the following error: error: flake 'git+file://…' does not provide attribute 'devShells.x86_64-linuxhaskell', 'packages.x86_64-linux.haskell', 'legacyPackages.x86_64-linux.haskell' or 'haskell'
2021-08-19nix develop --phase: chdir to flake directoryMatthew Kenigsberg
For git+file and path flakes, chdir to flake directory so that phases that expect to be in the flake directory can run Fixes https://github.com/NixOS/nix/issues/3976
2021-07-27nix develop: Support chroot storesEelco Dolstra
Fixes #5024.
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-13nix develop: Search in `devShells.${system}` by defaultregnat
Make `nix develop .#foo` search `.#devShells.${system}.foo` first
2021-07-12Merge branch 'master' into structured-attrs-shellMaximilian Bosch
Conflicts: src/nix/develop.cc src/nix/get-env.sh tests/shell.nix
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