Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 852d81d6077d
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 7f7687e79f42
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 23, 2019

  1. mkShell: compose shellHooks

    Running the following expression with nix-shell:
    
      let
        pkgs = import <nixpkgs> {};
    
        shell1 = pkgs.mkShell {
          shellHook = ''
            echo shell1
          '';
        };
    
        shell2 = pkgs.mkShell {
          shellHook = ''
            echo shell2
          '';
        };
    
        shell3 = pkgs.mkShell {
          inputsFrom = [ shell1 shell2 ];
          shellHook = ''
            echo shell3
          '';
        };
      in shell3
    
    Will now results in:
    shell2
    shell1
    shell3
    
    Note that packages in the front of inputsFrom have precedence over
    packages in the back. The outermost mkShell has precedence over all.
    basvandijk committed Jun 23, 2019
    Copy the full SHA
    76ef802 View commit details
    Browse the repository at this point in the history
  2. mkshell: improve mergeInputs

    mergeInputs is now simply defined in terms of `concatLists` and
    `catAttrs` instead of a more complicated `foldr`.
    
    Note that the order of PATH has also changed. For example running the
    following with nix-shell:
    
      let
        pkgs = import <nixpkgs> {};
    
        shell1 = pkgs.mkShell {
          buildInputs = [ pkgs.htop ];
        };
    
        shell2 = pkgs.mkShell {
          buildInputs = [ pkgs.hello ];
        };
    
        shell3 = pkgs.mkShell {
          inputsFrom = [ shell1 shell2 ];
          buildInputs = [ pkgs.tree ];
        };
    
      in shell3
    
    Results in the following PATH:
    
    $ echo $PATH
    ...
    /nix/store/yifq4bikf7m07160bpia7z48ciqddbfi-tree-1.8.0/bin:
    /nix/store/vhxqk81234ivqw1a7j200a1c69k8mywi-htop-2.2.0/bin:
    /nix/store/n9vm3m58y1n3rg3mlll17wanc9hln58k-hello-2.10/bin
    ...
    
    Previously the order was:
    
    /nix/store/n9vm3m58y1n3rg3mlll17wanc9hln58k-hello-2.10/bin
    /nix/store/vhxqk81234ivqw1a7j200a1c69k8mywi-htop-2.2.0/bin:
    /nix/store/yifq4bikf7m07160bpia7z48ciqddbfi-tree-1.8.0/bin:
    
    I think the new order makes more sense because it allows to override
    the PATH in the outermost mkShell.
    basvandijk committed Jun 23, 2019
    Copy the full SHA
    cee3573 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #63701 from basvandijk/composable-mkshell-shellHook

    Improve composability of mkShell
    zimbatm committed Jun 23, 2019
    Copy the full SHA
    7f7687e View commit details
    Browse the repository at this point in the history