Skip to content
Snippets Groups Projects
Commit f7d22a82 authored by Tom Prince's avatar Tom Prince
Browse files

Merge branch 'nix-path-copy' into 'develop'

Avoid copying nixpkgs to the store a second time in nix-shell.

See merge request !168
parents 388edf0b 6032eb03
No related branches found
No related tags found
3 merge requests!180merge develop into production,!177merge develop into staging,!168Avoid copying nixpkgs to the store a second time in nix-shell.
Pipeline #1131 passed
......@@ -3,8 +3,17 @@ let
in
{ pkgs ? release2105 }:
pkgs.mkShell {
# When a path (such as `pkgs.path`) is interpolated into a string then nix
# first adds that path to the store, and then interpolates the store path
# into the string. We use `builtins.toString` to convert the path to a
# string without copying it to the store before interpolating. Either the
# path is already in the store (e.g. when `pkgs` is `release2105`) so we
# avoid making a second copy with a longer name, or the user passed in local
# path (e.g. a checkout of nixpkgs) and we point at it directly, rather than
# a snapshot of it.
# See https://github.com/NixOS/nix/issues/200 and https://github.com/NixOS/nix/issues/1728
shellHook = ''
export NIX_PATH="nixpkgs=${pkgs.path}";
export NIX_PATH="nixpkgs=${builtins.toString pkgs.path}";
'';
buildInputs = [
pkgs.morph
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment