commit 5685791c8faee627809b67e3540f5826c941d49c
parent 9260f3e2b6e09ff31f231241101e5e20c11f5319
Author: Vincent Demeester <vincent@sbr.pm>
Date: Tue, 15 Mar 2022 14:56:18 +0100
nix/packages: init tkn-local at v0.2.0
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
3 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/nix/packages/default.nix b/nix/packages/default.nix
@@ -113,6 +113,10 @@ rec {
tkn-pac_0_5
tkn-pac
;
+ inherit (pkgs.callPackage ./tkn/tkn-local.nix { })
+ tkn-local_0_2
+ tkn-local
+ ;
manifest-tool = pkgs.callPackage ./manifest-tool { };
# Upstream
diff --git a/nix/packages/tkn/tkn-local.nix b/nix/packages/tkn/tkn-local.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, buildGoModule, fetchFromGitHub }:
+
+with lib;
+rec {
+ tknLocalGen = { version, sha256 }:
+ buildGoModule rec {
+ pname = "tkn-local";
+ name = "${pname}-${version}";
+
+ subPackages = [ "cmd/tkn-local" ];
+ ldflags = [
+ "-s"
+ "-w"
+ ];
+ src = fetchFromGitHub {
+ owner = "vdemeester";
+ repo = "buildkit-tekton";
+ rev = "v${version}";
+ sha256 = "${sha256}";
+ };
+ vendorSha256 = null;
+ doCheck = false;
+
+ postInstall = ''
+ # manpages
+ manRoot="$out/share/man"
+ mkdir -p "$manRoot/man1"
+ for manFile in docs/man/man1/*; do
+ manName="$(basename "$manFile")" # "docker-build.1"
+ gzip -c "$manFile" > "$manRoot/man1/$manName.gz"
+ done
+ # completions
+ mkdir -p $out/share/bash-completion/completions/
+ $out/bin/tkn-local completion bash > $out/share/bash-completion/completions/tkn-local
+ mkdir -p $out/share/zsh/site-functions
+ $out/bin/tkn-local completion zsh > $out/share/zsh/site-functions/_tkn-local
+ '';
+ meta = with lib; {
+ homepage = https://github.com/vdemeester/buildkit-tekton;
+ description = "A Tekton CLI extension for running tekton resources locally";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ vdemeester ];
+ };
+ };
+ tkn-local = tkn-local_0_2;
+ tkn-local_0_2 = makeOverridable tknLocalGen {
+ version = "0.2.0";
+ sha256 = "sha256-Y4wFFdUxzveHguJfs9LQRCqAc143hwNqGx0TJv9cr44=";
+ };
+}
diff --git a/users/vincent/containers/tekton.nix b/users/vincent/containers/tekton.nix
@@ -5,5 +5,6 @@
# tektoncd-cli
my.tkn
my.tkn-pac
+ my.tkn-local
];
}