2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoconf, bison, flex, libtool, pkg-config, which
|
2022-09-16 09:39:20 +00:00
|
|
|
, libnl, protobuf, protobufc, shadow, installShellFiles
|
2018-12-04 21:47:48 +00:00
|
|
|
}:
|
2015-08-10 17:34:09 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nsjail";
|
2022-10-15 12:45:29 +00:00
|
|
|
version = "3.2";
|
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;
|
2022-10-15 12:45:29 +00:00
|
|
|
sha256 = "sha256-SFRnCEPawMKEIdmrOnJ45IIb17W1d4qCceuRdWTDTQU=";
|
2015-08-10 17:34:09 +00:00
|
|
|
};
|
|
|
|
|
2022-09-16 09:39:20 +00:00
|
|
|
nativeBuildInputs = [ autoconf bison flex libtool pkg-config which installShellFiles ];
|
2018-10-10 21:33:43 +00:00
|
|
|
buildInputs = [ libnl protobuf protobufc ];
|
2017-11-04 19:02:23 +00:00
|
|
|
enableParallelBuilding = true;
|
2017-10-21 22:13:11 +00:00
|
|
|
|
2020-07-23 15:49:56 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(USER_DEFINES='-DNEWUIDMAP_PATH=${shadow}/bin/newuidmap -DNEWGIDMAP_PATH=${shadow}/bin/newgidmap')
|
|
|
|
'';
|
|
|
|
|
2015-08-10 17:34:09 +00:00
|
|
|
installPhase = ''
|
2022-09-16 09:39:20 +00:00
|
|
|
install -Dm755 nsjail "$out/bin/nsjail"
|
|
|
|
installManPage nsjail.1
|
2015-08-10 17:34:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-10-21 22:13:11 +00:00
|
|
|
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;
|
2020-07-23 15:49:56 +00:00
|
|
|
maintainers = with maintainers; [ arturcygan bosu c0bw3b ];
|
2017-10-21 22:13:11 +00:00
|
|
|
platforms = platforms.linux;
|
2015-08-10 17:34:09 +00:00
|
|
|
};
|
|
|
|
}
|