2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2022-09-09 14:08:57 +00:00
|
|
|
, buildGoModule
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-04-05 15:23:46 +00:00
|
|
|
, iproute2
|
2020-04-24 23:36:52 +00:00
|
|
|
, iptables
|
|
|
|
, makeWrapper
|
|
|
|
, procps
|
|
|
|
}:
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildGoModule rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "gvisor";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "20221102.1";
|
2022-09-22 12:36:57 +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)"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
2022-09-09 14:08:57 +00:00
|
|
|
repo = "gvisor";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "bf8eeee3a9eb966bc72c773da060a3c8bb73b8ff";
|
|
|
|
sha256 = "sha256-rADQsJ+AnBVlfQURGJl1xR6Ad5NyRWSrBSpOFMRld+o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
vendorSha256 = "sha256-iGLWxx/Kn1QaJTNOZcc+mwoF3ecEDOkaqmA0DH4pdgU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
subPackages = [ "runsc" "shim" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postInstall = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
# Needed for the 'runsc do' subcommand
|
2022-09-09 14:08:57 +00:00
|
|
|
wrapProgram $out/bin/runsc \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ iproute2 iptables procps ]}
|
|
|
|
mv $out/bin/shim $out/bin/containerd-shim-runsc-v1
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-09-09 14:08:57 +00:00
|
|
|
description = "Application Kernel for Containers";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/google/gvisor";
|
|
|
|
license = licenses.asl20;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ andrew-d gpl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|