2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, autoconf, bison, flex, libtool, pkgconfig, which
|
|
|
|
, libnl, protobuf, protobufc, shadow
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nsjail";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "nsjail";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "1w6x8xcrs0i1y3q41gyq8z3cq9x24qablklc4jiydf855lhqn4dh";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf bison flex libtool pkgconfig which ];
|
|
|
|
buildInputs = [ libnl protobuf protobufc ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(USER_DEFINES='-DNEWUIDMAP_PATH=${shadow}/bin/newuidmap -DNEWGIDMAP_PATH=${shadow}/bin/newgidmap')
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/man/man1
|
|
|
|
install nsjail $out/bin/
|
|
|
|
install nsjail.1 $out/share/man/man1/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A light-weight process isolation tool, making use of Linux namespaces and seccomp-bpf syscall filters";
|
|
|
|
homepage = "http://nsjail.com/";
|
|
|
|
license = licenses.asl20;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ arturcygan bosu c0bw3b ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|