2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2023-11-21 02:23:40 +00:00
|
|
|
, nixosTests
|
2022-09-07 09:30:52 +00:00
|
|
|
, buildGoModule
|
2019-10-27 03:18:26 +00:00
|
|
|
, fetchFromGitHub
|
2021-03-14 16:05:16 +00:00
|
|
|
, iproute2
|
2019-10-27 03:18:26 +00:00
|
|
|
, iptables
|
|
|
|
, makeWrapper
|
|
|
|
, procps
|
|
|
|
}:
|
|
|
|
|
2023-11-21 02:23:40 +00:00
|
|
|
buildGoModule {
|
2022-03-07 11:37:20 +00:00
|
|
|
pname = "gvisor";
|
2023-11-21 02:23:40 +00:00
|
|
|
version = "20231113.0";
|
2022-09-21 15:47:20 +00:00
|
|
|
|
|
|
|
# gvisor provides a synthetic go branch (https://github.com/google/gvisor/tree/go)
|
|
|
|
# that can be used to build gvisor without bazel.
|
|
|
|
# For updates, you should stick to the commits labeled "Merge release-** (automated)"
|
2019-10-27 03:18:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
2022-09-07 09:30:52 +00:00
|
|
|
repo = "gvisor";
|
2023-11-21 02:23:40 +00:00
|
|
|
rev = "cdaf5c462c4040ed4cc88989e43f7d373acb9d24";
|
|
|
|
hash = "sha256-9d2AJXoGFRCSM6900gOBxNBgL6nxXqz/pPan5EeEdsI=";
|
2019-10-27 03:18:26 +00:00
|
|
|
};
|
|
|
|
|
2023-11-21 02:23:40 +00:00
|
|
|
vendorHash = "sha256-QdsVELNcIVsZv2gA05YgQfMZ6hmnfN2GGqW6r+mHqbs=";
|
2019-10-27 03:18:26 +00:00
|
|
|
|
2022-09-07 09:30:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-10-27 03:18:26 +00:00
|
|
|
|
2022-09-21 15:47:20 +00:00
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
2022-09-07 09:30:52 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2019-10-27 03:18:26 +00:00
|
|
|
|
2022-09-07 09:30:52 +00:00
|
|
|
subPackages = [ "runsc" "shim" ];
|
2019-10-27 03:18:26 +00:00
|
|
|
|
2022-09-07 09:30:52 +00:00
|
|
|
postInstall = ''
|
2023-05-08 16:16:15 +00:00
|
|
|
# Needed for the 'runsc do' subcommand
|
2022-09-07 09:30:52 +00:00
|
|
|
wrapProgram $out/bin/runsc \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ iproute2 iptables procps ]}
|
|
|
|
mv $out/bin/shim $out/bin/containerd-shim-runsc-v1
|
|
|
|
'';
|
2019-10-27 03:18:26 +00:00
|
|
|
|
2023-11-21 02:23:40 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) gvisor; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-09-07 09:30:52 +00:00
|
|
|
description = "Application Kernel for Containers";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/google/gvisor";
|
2019-10-27 03:18:26 +00:00
|
|
|
license = licenses.asl20;
|
2022-09-07 09:30:52 +00:00
|
|
|
maintainers = with maintainers; [ andrew-d gpl ];
|
2019-10-27 03:18:26 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|