nixpkgs/pkgs/tools/security/nsjail/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.3 KiB
Nix
Raw Normal View History

2021-01-17 03:51:22 +00:00
{ lib, stdenv, fetchFromGitHub, autoconf, bison, flex, libtool, pkg-config, which
2022-09-16 10:39:20 +01:00
, libnl, protobuf, protobufc, shadow, installShellFiles
}:
2015-08-10 18:34:09 +01:00
stdenv.mkDerivation rec {
pname = "nsjail";
2023-10-11 20:58:01 +01:00
version = "3.4";
2015-08-10 18:34:09 +01:00
2017-10-21 23:13:11 +01:00
src = fetchFromGitHub {
owner = "google";
repo = "nsjail";
rev = version;
fetchSubmodules = true;
2023-10-11 20:58:01 +01:00
hash = "sha256-/K+qJV5Dq+my45Cpw6czdsWLtO9lnJwZTsOIRt4Iijk=";
2015-08-10 18:34:09 +01:00
};
nativeBuildInputs = [ autoconf bison flex installShellFiles libtool pkg-config which ];
2018-10-10 22:33:43 +01:00
buildInputs = [ libnl protobuf protobufc ];
enableParallelBuilding = true;
2017-10-21 23:13:11 +01:00
2024-01-19 14:20:43 +00:00
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error" ];
2020-07-23 16:49:56 +01:00
preBuild = ''
makeFlagsArray+=(USER_DEFINES='-DNEWUIDMAP_PATH=${shadow}/bin/newuidmap -DNEWGIDMAP_PATH=${shadow}/bin/newgidmap')
'';
2015-08-10 18:34:09 +01:00
installPhase = ''
runHook preInstall
2022-09-16 10:39:20 +01:00
install -Dm755 nsjail "$out/bin/nsjail"
installManPage nsjail.1
runHook postInstall
2015-08-10 18:34:09 +01:00
'';
meta = with lib; {
2017-10-21 23:13:11 +01:00
description = "Light-weight process isolation tool, making use of Linux namespaces and seccomp-bpf syscall filters";
homepage = "https://nsjail.dev/";
2023-10-11 20:58:01 +01:00
changelog = "https://github.com/google/nsjail/releases/tag/${version}";
license = licenses.asl20;
2020-07-23 16:49:56 +01:00
maintainers = with maintainers; [ arturcygan bosu c0bw3b ];
2017-10-21 23:13:11 +01:00
platforms = platforms.linux;
2023-11-23 02:51:17 +00:00
mainProgram = "nsjail";
2015-08-10 18:34:09 +01:00
};
}