aboutsummaryrefslogtreecommitdiff
path: root/src/nix/shell.cc
AgeCommit message (Collapse)Author
2020-04-01Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-03-31nix shell -> nix dev-shellEelco Dolstra
2020-03-30Backport 'nix dev-shell' from the flakes branchEelco Dolstra
This also adds a '--profile' option to 'nix build' (replacing 'nix-env --set').
2020-02-27nix dev-shell: Add --command optionEelco Dolstra
Note: like 'nix run', and unlike 'nix-shell', this takes an argv vector rather than a shell command. So nix dev-shell -c 'echo $PATH' doesn't work. Instead you need to do nix dev-shell -c bash -c 'echo $PATH'
2019-12-11Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-12-04Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-12-02Merge branch 'run-environment' of https://github.com/mkenigs/nix into flakesEelco Dolstra
2019-11-12nix dev-shell: Improve bash output parsingEelco Dolstra
Fixes handling of '=' in unquoted strings and escaped characters in $'...' strings.
2019-11-07use MixEnvironment in run and shellmatthew
2019-10-15Support non-x86_64-linux system types in flakesEelco Dolstra
A command like $ nix run nixpkgs#hello will now build the attribute 'packages.${system}.hello' rather than 'packages.hello'. Note that this does mean that the flake needs to export an attribute for every system type it supports, and you can't build on unsupported systems. So 'packages' typically looks like this: packages = nixpkgs.lib.genAttrs ["x86_64-linux" "i686-linux"] (system: { hello = ...; }); The 'checks', 'defaultPackage', 'devShell', 'apps' and 'defaultApp' outputs similarly are now attrsets that map system types to derivations/apps. 'nix flake check' checks that the derivations for all platforms evaluate correctly, but only builds the derivations in 'checks.${system}'. Fixes #2861. (That issue also talks about access to ~/.config/nixpkgs and --arg, but I think it's reasonable to say that flakes shouldn't support those.) The alternative to attribute selection is to pass the system type as an argument to the flake's 'outputs' function, e.g. 'outputs = { self, nixpkgs, system }: ...'. However, that approach would be at odds with hermetic evaluation and make it impossible to enumerate the packages provided by a flake.
2019-10-07deleted commentEmilio Karakey
2019-10-02nix dev-shell: Ignore $NIX_LOG_FDEelco Dolstra
2019-09-27nix dev-shell: Improve environment handlingEelco Dolstra
Only variables that were marked as exported are exported in the dev shell. Also, we no longer try to parse the function section of the env file, fixing $ nix dev-shell error: shell environment '/nix/store/h7ama3kahb8lypf4nvjx34z06g9ncw4h-nixops-1.7pre20190926.4c7acbb-env' has unexpected line '/^[a-z]?"""/ {'
2019-08-09nix dev-shell: Set dontAddDisableDepTrackEelco Dolstra
2019-07-26nix dev-shell: Set IN_NIX_SHELL in the derivationEelco Dolstra
This ensures that stdenv / setup hooks take $IN_NIX_SHELL into account. For example, stdenv only sets NIX_SSL_CERT_FILE=/no-cert-file.crt if we're not in a shell.
2019-07-12nix dev-shell: Make it possible to enter a profileEelco Dolstra
For example: $ nix dev-shell --profile /tmp/my-shell dwarffs (later) $ nix dev-shell /tmp/my-shell
2019-07-12Refactor a bitEelco Dolstra
2019-07-12nix dev-shell: Add --profile flagEelco Dolstra
This is useful to prevent the shell environment from being garbage-collected.
2019-06-18Make subcommand construction in MultiCommand lazyEelco Dolstra
2019-05-11nix dev-shell: Ignore SSL_CERT_FILEEelco Dolstra
2019-05-08nix dev-shell: Keep $TERMEelco Dolstra
2019-05-02nix dev-shell: Less purityEelco Dolstra
2019-05-02Move createTempFile to libutilEelco Dolstra
2019-05-02nix dev-shell: Execute shellHookEelco Dolstra
2019-05-02nix dev-shell: Use 'provides.devShell' by defaultEelco Dolstra
Thus $ nix dev-shell will now build the 'provides.devShell' attribute from the flake in the current directory. If it doesn't exist, it falls back to 'provides.defaultPackage'.
2019-05-02Add 'nix dev-shell' and 'nix print-dev-env' commandEelco Dolstra
'nix dev-shell' is intended to replace nix-shell. It supports flakes, e.g. $ nix dev-shell nixpkgs:hello starts a bash shell providing an environment for building 'hello'. Like Lorri (and unlike nix-shell), it computes the build environment by building a modified top-level derivation that writes the environment after running $stdenv/setup to $out and exits. This provides some caching, so it's faster than nix-shell in some cases (especially for packages with lots of dependencies, where the setup script takes a long time). There also is a command 'nix print-dev-env' that prints out shell code for setting up the build environment in an existing shell, e.g. $ . <(nix print-dev-env nixpkgs:hello) https://github.com/tweag/nix/issues/21