forked from BarrelfishOS/barrelfish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kosyrev Serge <skosyrev@ptsecurity.com>
Kosyrev Serge
committed
Dec 20, 2016
1 parent
db283a1
commit 73fb4fa
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ stdenv, fetchgit, haskell | ||
|
||
, autoconf | ||
, automake | ||
, binutils | ||
, coreutils | ||
, curl | ||
, gcc5 | ||
, git | ||
, gmp | ||
, gnugrep | ||
, gnused | ||
, m4 | ||
|
||
, ghc-version ? "ghc801" | ||
|
||
, propagate-deps ? false | ||
, use-repo-source ? false | ||
, repo-url ? "" | ||
, repo-commit-id ? "" | ||
, repo-commit-sha256 ? "" | ||
}: | ||
|
||
let src-repo = fetchgit { | ||
url = repo-url; | ||
rev = repo-commit-id; | ||
sha256 = repo-commit-sha256; | ||
}; | ||
ghc = haskell.packages."${ghc-version}".ghcWithPackages | ||
(haskellPackages: with haskellPackages; [ | ||
async | ||
bytestring-trie | ||
ghc-paths | ||
ghc-mtl | ||
haskell-src-exts | ||
parsec | ||
random | ||
]); | ||
deps = [ | ||
autoconf | ||
automake | ||
binutils | ||
coreutils | ||
curl | ||
gcc5 | ||
git | ||
gmp | ||
gnugrep | ||
gnused | ||
m4 | ||
|
||
# custom GHC | ||
ghc | ||
]; | ||
in | ||
stdenv.mkDerivation { | ||
version = "2016-11-09"; | ||
name = "barrelfish"; | ||
src = if use-repo-source | ||
then src-repo | ||
else builtins.filterSource | ||
(path: type: baseNameOf path != ".git" && baseNameOf path != "build") | ||
./.; | ||
|
||
buildInputs = deps; | ||
propagatedBuildInputs = if propagate-deps | ||
then deps | ||
else []; | ||
|
||
description = "The Barrelfish OS"; | ||
license = "MIT"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# How to employ Nix to compose/deploy the build environment: | ||
# | ||
# 1. Get derivation path: | ||
# | ||
# $ 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"; }') | ||
# | ||
# 2. Export closure on the source host: | ||
# | ||
# $ nix-store --export $(nix-store --query --requisites --include-outputs ${STOREDRVPATH}) > ~/barrelfish.closure | ||
# | ||
# 3. Import closure on the target host (and transfer the value of STOREDRVPATH): | ||
# | ||
# $ nix-store --import barrelfish.closure | ||
# | ||
# 4. Enter shell : | ||
# | ||
# $ nix-shell ${STOREDRVPATH} | ||
|
||
{ nixpkgs ? import <nixpkgs> {} | ||
, ghc-version ? "ghc801" | ||
|
||
, closure-generation-mode ? false | ||
, propagate-deps ? closure-generation-mode | ||
, use-repo-source ? closure-generation-mode | ||
, repo-url ? "" | ||
, repo-commit-id ? "" | ||
, repo-commit-sha256 ? "" | ||
}: | ||
|
||
let | ||
|
||
inherit (nixpkgs) pkgs; | ||
|
||
f = import ./.; # your default.nix | ||
|
||
in | ||
|
||
pkgs.callPackage f { | ||
haskell = pkgs.haskell; | ||
|
||
inherit ghc-version; | ||
inherit propagate-deps use-repo-source repo-url repo-commit-id repo-commit-sha256; | ||
} |