nixpkgs/pkgs/applications/virtualization/rkt/default.nix

64 lines
1.9 KiB
Nix
Raw Normal View History

2016-02-05 06:41:35 +00:00
{ stdenv, lib, autoreconfHook, acl, go, file, git, wget, gnupg1, trousers, squashfsTools,
2016-01-15 13:11:08 +00:00
cpio, fetchurl, fetchFromGitHub, iptables, systemd, makeWrapper }:
2015-08-19 10:04:34 +00:00
let
2016-02-05 06:41:35 +00:00
coreosImageRelease = "835.12.0";
coreosImageSystemdVersion = "225";
# TODO: track https://github.com/coreos/rkt/issues/1758 to allow "host" flavor.
2016-01-15 13:11:08 +00:00
stage1Flavours = [ "coreos" "fly" "host" ];
in stdenv.mkDerivation rec {
2016-02-05 06:41:35 +00:00
version = "1.0.0";
2015-08-19 10:04:34 +00:00
name = "rkt-${version}";
BUILDDIR="build-${name}";
2015-08-19 10:04:34 +00:00
src = fetchFromGitHub {
rev = "v${version}";
owner = "coreos";
repo = "rkt";
2016-02-05 06:41:35 +00:00
sha256 = "1m76hzx550dh35jpb8m46ks04ac3dfy4rg054v035rpwgh50ac6h";
2015-08-19 10:04:34 +00:00
};
stage1BaseImage = fetchurl {
2016-02-05 06:41:35 +00:00
url = "http://stable.release.core-os.net/amd64-usr/${coreosImageRelease}/coreos_production_pxe_image.cpio.gz";
sha256 = "0djzgfcqr9yy13i415204ji82lrk8mvdhl9rxjr123j1glf5sdh3";
};
2016-01-15 13:11:08 +00:00
buildInputs = [
2016-02-05 06:41:35 +00:00
autoreconfHook go file git wget gnupg1 trousers squashfsTools cpio acl systemd
2016-01-15 13:11:08 +00:00
makeWrapper
];
2015-08-19 10:04:34 +00:00
preConfigure = ''
./autogen.sh
configureFlagsArray=(
--with-stage1-flavors=${builtins.concatStringsSep "," stage1Flavours}
${if lib.findFirst (p: p == "coreos") null stage1Flavours != null then "
--with-coreos-local-pxe-image-path=${stage1BaseImage}
--with-coreos-local-pxe-image-systemd-version=v${coreosImageSystemdVersion}
" else "" }
);
2015-08-19 10:04:34 +00:00
'';
preBuild = ''
export BUILDDIR
'';
2015-08-19 10:04:34 +00:00
installPhase = ''
mkdir -p $out/bin
cp -Rv $BUILDDIR/bin/* $out/bin
2016-01-15 13:11:08 +00:00
wrapProgram $out/bin/rkt \
--prefix LD_LIBRARY_PATH : ${systemd}/lib \
--prefix PATH : ${iptables}/bin
2015-08-19 10:04:34 +00:00
'';
2015-08-19 10:04:34 +00:00
meta = with lib; {
description = "A fast, composable, and secure App Container runtime for Linux";
homepage = https://github.com/coreos/rkt;
2015-08-19 10:04:34 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ ragge steveej ];
2015-08-26 16:55:22 +00:00
platforms = [ "x86_64-linux" ];
2015-08-19 10:04:34 +00:00
};
}