Caching nix shell build inputs: Difference between revisions
imported>Fzakaria Created page with "== Problem statement == Caching a Nix build is ''straightforward'' if there's a build result. We can use {{ic|nix-store --query --requisites}} to query the runtime closure of..." |
imported>Ericson2314 m Make the shell.nix example ideomatically respect the buildInputs nativeBuildInputs distinction |
||
| Line 6: | Line 6: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
let | let pkgs = import <nixpkgs> {}; | ||
in | in | ||
with | with pkgs.stdenv; | ||
with pkgs.stdenv.lib; | |||
with stdenv.lib; | pkgs.mkShell { | ||
mkShell { | |||
name = "example-shell"; | name = "example-shell"; | ||
buildInputs = []; | nativeBuildInputs = with pkgs.buildPackages; [ /* tools */ ]; | ||
buildInputs = with pkgs; [ /* libs */ ]; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||