1 # How to employ Nix to compose/deploy the build environment:
3 # 1. Get derivation path:
5 # $ STOREDRVPATH=$(nix-instantiate --no-build-output --cores 4 -E 'import ./shell.nix { closure-generation-mode = true; repo-commit-id="commit-id"; repo-commit-sha256="nix-hash"; }')
7 # 2. Export closure on the source host:
9 # $ nix-store --export $(nix-store --query --requisites --include-outputs ${STOREDRVPATH}) > ~/barrelfish.closure
11 # 3. Import closure on the target host (and transfer the value of STOREDRVPATH):
13 # $ nix-store --import barrelfish.closure
17 # $ nix-shell ${STOREDRVPATH}
19 { nixpkgs ? import <nixpkgs> {}
20 , ghc-version ? "ghc801"
22 , closure-generation-mode ? false
23 , propagate-deps ? closure-generation-mode
24 , use-repo-source ? closure-generation-mode
27 , repo-commit-sha256 ? ""
32 inherit (nixpkgs) pkgs;
34 f = import ./.; # your default.nix
39 haskell = pkgs.haskell;
42 inherit propagate-deps use-repo-source repo-url repo-commit-id repo-commit-sha256;