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

73 lines
2.3 KiB
Nix
Raw Normal View History

2016-02-05 07:41:35 +01:00
{ stdenv, lib, autoreconfHook, acl, go, file, git, wget, gnupg1, trousers, squashfsTools,
2016-04-23 20:33:21 +02:00
cpio, fetchurl, fetchFromGitHub, iptables, systemd, makeWrapper, glibc }:
2015-08-19 12:04:34 +02:00
let
2016-06-08 17:43:42 +02:00
# Always get the information from
# https://github.com/coreos/rkt/blob/v${VERSION}/stage1/usr_from_coreos/coreos-common.mk
2016-09-06 23:04:17 +02:00
coreosImageRelease = "1151.0.0";
coreosImageSystemdVersion = "231";
# TODO: track https://github.com/coreos/rkt/issues/1758 to allow "host" flavor.
2016-06-24 21:55:03 +02:00
stage1Flavours = [ "coreos" "fly" ];
2016-07-23 03:18:29 +02:00
stage1Dir = "lib/rkt/stage1-images";
in stdenv.mkDerivation rec {
2016-09-23 11:42:51 +02:00
version = "1.15.0";
2015-08-19 12:04:34 +02:00
name = "rkt-${version}";
BUILDDIR="build-${name}";
2015-08-19 12:04:34 +02:00
src = fetchFromGitHub {
owner = "coreos";
repo = "rkt";
2016-09-23 11:42:51 +02:00
rev = "v${version}";
sha256 = "0ppi6r3wr69s6ka1j9xljvq3rw2chp8syyvqcx6ijnzjbwgbwar3";
2015-08-19 12:04:34 +02:00
};
stage1BaseImage = fetchurl {
url = "http://alpha.release.core-os.net/amd64-usr/${coreosImageRelease}/coreos_production_pxe_image.cpio.gz";
2016-09-06 23:04:17 +02:00
sha256 = "1j75ad1g217aqar84m9ycl2m71g821hq9yahl4bgjaipx9xnj23g";
};
2016-01-15 14:11:08 +01:00
buildInputs = [
2016-04-23 20:33:21 +02:00
glibc.out glibc.static
2016-02-05 07:41:35 +01:00
autoreconfHook go file git wget gnupg1 trousers squashfsTools cpio acl systemd
2016-01-15 14:11:08 +01:00
makeWrapper
];
2015-08-19 12:04:34 +02: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 "" }
2016-07-23 03:18:29 +02:00
--with-stage1-default-location=$out/${stage1Dir}/stage1-${builtins.elemAt stage1Flavours 0}.aci
);
2015-08-19 12:04:34 +02:00
'';
preBuild = ''
export BUILDDIR
'';
2015-08-19 12:04:34 +02:00
installPhase = ''
mkdir -p $out/bin
cp -Rv $BUILDDIR/target/bin/rkt $out/bin
mkdir -p $out/lib/rkt/stage1-images/
2016-07-23 03:18:29 +02:00
cp -Rv $BUILDDIR/target/bin/stage1-*.aci $out/${stage1Dir}/
2016-01-15 14:11:08 +01:00
wrapProgram $out/bin/rkt \
--prefix LD_LIBRARY_PATH : ${systemd}/lib \
--prefix PATH : ${iptables}/bin
2015-08-19 12:04:34 +02:00
'';
2015-08-19 12:04:34 +02:00
meta = with lib; {
description = "A fast, composable, and secure App Container runtime for Linux";
homepage = https://github.com/coreos/rkt;
2015-08-19 12:04:34 +02:00
license = licenses.asl20;
maintainers = with maintainers; [ ragge steveej ];
2015-08-26 18:55:22 +02:00
platforms = [ "x86_64-linux" ];
2015-08-19 12:04:34 +02:00
};
}