Files
nixpkgs/pkgs/tools/networking/flannel/plugin.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

50 lines
1.1 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "cni-plugin-flannel";
version = "1.8.0-flannel2";
src = fetchFromGitHub {
owner = "flannel-io";
repo = "cni-plugin";
rev = "v${version}";
sha256 = "sha256-VZT53yhTqpFcVI45dTLyQFNTnpvDyn1g/2yF2KqUALw=";
};
vendorHash = "sha256-4nwUUwkEnhzQ0hTL1WtTnAZA8/kVJ4/Gyg9UZQpNkpc=";
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
"-X main.Commit=${version}"
"-X main.Program=flannel"
];
postInstall = ''
mv $out/bin/cni-plugin $out/bin/flannel
'';
doCheck = false;
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/flannel 2>&1 | fgrep -q $version
runHook postInstallCheck
'';
meta = {
description = "Network fabric for containers designed to work in conjunction with flannel";
mainProgram = "flannel";
homepage = "https://github.com/flannel-io/cni-plugin/";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ abbe ];
};
}