1{ lib
2, cni-plugins
3, buildGoModule
4, firecracker
5, containerd
6, runc
7, makeWrapper
8, fetchFromGitHub
9}:
10
11buildGoModule rec{
12 pname = "flintlock";
13 version = "0.6.0";
14
15 src = fetchFromGitHub {
16 owner = "weaveworks";
17 repo = "flintlock";
18 rev = "v${version}";
19 sha256 = "sha256-jZi58mewQ2hlH/9H4iAF4Mvf9UK4F7sUR0xcCEaLzX0=";
20 };
21
22 vendorHash = "sha256-IGfNMe1fQfAGAOVsxmn/oxleHfniqL1TJKllCwpuWOU=";
23
24 subPackages = [ "cmd/flintlock-metrics" "cmd/flintlockd" ];
25
26 ldflags = [ "-s" "-w" "-X github.com/weaveworks/flintlock/internal/version.Version=v${version}" ];
27
28 nativeBuildInputs = [
29 makeWrapper
30 ];
31
32 buildInputs = [
33 firecracker
34 ];
35
36 postInstall = ''
37 for prog in flintlockd flintlock-metrics; do
38 wrapProgram "$out/bin/$prog" --prefix PATH : ${lib.makeBinPath [ cni-plugins firecracker containerd runc ]}
39 done
40 '';
41
42 meta = with lib; {
43 description = "Create and manage the lifecycle of MicroVMs backed by containerd";
44 homepage = "https://github.com/weaveworks-liquidmetal/flintlock";
45 license = licenses.mpl20;
46 platforms = [ "x86_64-linux" "aarch64-linux" ];
47 maintainers = with maintainers; [ techknowlogick ];
48 };
49}