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: 53346d725ffd
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 13781ee85c30
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Jun 24, 2019

  1. 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.
    
    (cherry picked from commit cee3573)
    basvandijk committed Jun 24, 2019
    Copy the full SHA
    e65b6ff View commit details
    Browse the repository at this point in the history
  2. 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.
    
    (cherry picked from commit 76ef802)
    basvandijk committed Jun 24, 2019
    Copy the full SHA
    0004631 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #63718 from basvandijk/composable-mkshell-shellHoo…

    …k-release-19.03
    
    Backport "Improve composability of mkShell" to release-19.03
    basvandijk committed Jun 24, 2019
    Copy the full SHA
    13781ee View commit details
    Browse the repository at this point in the history