depot/third_party/nixpkgs/pkgs/tools/security/isolate/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

60 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, asciidoc
, libcap
, pkg-config
, systemdLibs
, installShellFiles
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "isolate";
version = "2.0";
src = fetchFromGitHub {
owner = "ioi";
repo = "isolate";
rev = "v${version}";
hash = "sha256-kKXkXPVB9ojyIERvEdkHkXC//Agin8FPcpTBmTxh/ZE=";
};
nativeBuildInputs = [
asciidoc
installShellFiles
pkg-config
];
buildInputs = [
libcap.dev
systemdLibs.dev
];
patches = [
./take-config-file-from-env.patch
];
installPhase = ''
runHook preInstall
install -Dm755 ./isolate $out/bin/isolate
install -Dm755 ./isolate-cg-keeper $out/bin/isolate-cg-keeper
install -Dm755 ./isolate-check-environment $out/bin/isolate-check-environment
installManPage isolate.1
runHook postInstall
'';
passthru.tests = {
isolate = nixosTests.isolate;
};
meta = {
description = "Sandbox for securely executing untrusted programs";
mainProgram = "isolate";
homepage = "https://github.com/ioi/isolate";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ virchau13 ];
};
}