home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (2103B)


      1 { stdenv, lib, buildGoModule, fetchFromGitHub }:
      2 
      3 with lib;
      4 rec {
      5   tknGen = { version, sha256 }:
      6     buildGoModule rec {
      7       pname = "tkn";
      8       name = "${pname}-${version}";
      9 
     10       subPackages = [ "cmd/tkn" ];
     11       buildFlagsArray =
     12         let
     13           t = "github.com/tektoncd/cli/pkg/cmd/version";
     14         in
     15         ''
     16           -ldflags=
     17             -X ${t}.clientVersion=${version}
     18         '';
     19       src = fetchFromGitHub {
     20         owner = "tektoncd";
     21         repo = "cli";
     22         rev = "v${version}";
     23         sha256 = "${sha256}";
     24       };
     25       vendorSha256 = null;
     26 
     27       postInstall = ''
     28         # manpages
     29         manRoot="$out/share/man"
     30         mkdir -p "$manRoot/man1"
     31         for manFile in docs/man/man1/*; do
     32           manName="$(basename "$manFile")" # "docker-build.1"
     33           gzip -c "$manFile" > "$manRoot/man1/$manName.gz"
     34         done
     35         # completions
     36         mkdir -p $out/share/bash-completion/completions/
     37         $out/bin/tkn completion bash > $out/share/bash-completion/completions/tkn
     38         mkdir -p $out/share/zsh/site-functions
     39         $out/bin/tkn completion zsh > $out/share/zsh/site-functions/_tkn
     40       '';
     41       meta = with lib; {
     42         homepage = https://github.com/tektoncd/cli;
     43         description = "A CLI for interacting with Tekton!";
     44         license = licenses.asl20;
     45         maintainers = with maintainers; [ vdemeester ];
     46       };
     47     };
     48 
     49   tkn = tkn_0_21;
     50   tkn_0_21 = makeOverridable tknGen {
     51     version = "0.21.0";
     52     sha256 = "166jjf78crwkfzl7vd92y75x85jqlbid55ny3fhl96y456gmhrsl";
     53   };
     54   tkn_0_20 = makeOverridable tknGen {
     55     version = "0.20.0";
     56     sha256 = "125q6r90q9lz1qn3s3xa2006waxc5yyvgrswzgkczs4bv727am39";
     57   };
     58   tkn_0_19 = makeOverridable tknGen {
     59     version = "0.19.1";
     60     sha256 = "0vpwbmz8ij6kn61b0r3ayq9vqdsq8yb6scjnd6drb62b9r755qkn";
     61   };
     62   tkn_0_18 = makeOverridable tknGen {
     63     version = "0.18.0";
     64     sha256 = "1a8a82zy23lc00jnd3cklvrz6si9j84rg2rbq0cm35qladynk75x";
     65   };
     66   tkn_0_17 = makeOverridable tknGen {
     67     version = "0.17.2";
     68     sha256 = "0wqy8y19l6kay3v2danj10gw58j6l9b3616zn9w5pjbmbcwbslgd";
     69   };
     70 }