2018-10-10 21:33:43 +00:00
|
|
|
{ stdenv, fetchFromGitHub, autoconf, bison, flex, libtool, pkgconfig, which
|
2018-12-04 21:47:48 +00:00
|
|
|
, libnl, protobuf, protobufc, shadow
|
|
|
|
}:
|
2015-08-10 17:34:09 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nsjail";
|
2019-09-15 20:36:16 +00:00
|
|
|
version = "2.9";
|
2015-08-10 17:34:09 +00:00
|
|
|
|
2017-10-21 22:13:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "nsjail";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2019-09-15 20:36:16 +00:00
|
|
|
sha256 = "0218n0qjb45fawqqfj3gdxgd0fw5k0vxn9iggi0ciljmr9zywkgh";
|
2015-08-10 17:34:09 +00:00
|
|
|
};
|
|
|
|
|
2018-12-04 21:47:48 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace user.cc \
|
|
|
|
--replace "/usr/bin/newgidmap" "${shadow}/bin/newgidmap" \
|
|
|
|
--replace "/usr/bin/newuidmap" "${shadow}/bin/newuidmap"
|
|
|
|
'';
|
|
|
|
|
2018-10-10 21:33:43 +00:00
|
|
|
nativeBuildInputs = [ autoconf bison flex libtool pkgconfig which ];
|
|
|
|
buildInputs = [ libnl protobuf protobufc ];
|
2017-11-04 19:02:23 +00:00
|
|
|
enableParallelBuilding = true;
|
2017-10-21 22:13:11 +00:00
|
|
|
|
2015-08-10 17:34:09 +00:00
|
|
|
installPhase = ''
|
2017-11-04 19:02:23 +00:00
|
|
|
mkdir -p $out/bin $out/share/man/man1
|
|
|
|
install nsjail $out/bin/
|
|
|
|
install nsjail.1 $out/share/man/man1/
|
2015-08-10 17:34:09 +00:00
|
|
|
'';
|
|
|
|
|
2017-10-21 22:13:11 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A light-weight process isolation tool, making use of Linux namespaces and seccomp-bpf syscall filters";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://nsjail.com/";
|
2017-11-04 19:02:23 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bosu c0bw3b ];
|
2017-10-21 22:13:11 +00:00
|
|
|
platforms = platforms.linux;
|
2015-08-10 17:34:09 +00:00
|
|
|
};
|
|
|
|
}
|