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