home

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

default.nix (2198B)


      1 { stdenv, lib, buildGoModule, git, fetchFromGitHub }:
      2 
      3 with lib;
      4 rec {
      5   operatorSdkGen =
      6     { version
      7     , sha256
      8     , vendorSha256
      9     }:
     10 
     11     buildGoModule rec {
     12       inherit vendorSha256;
     13       pname = "operator-sdk";
     14       name = "${pname}-${version}";
     15       rev = "v${version}";
     16 
     17       builtInputs = [ "git" ];
     18 
     19       subPackages = [ "cmd/operator-sdk" ];
     20       buildFlagsArray =
     21         let
     22           t = "github.com/operator-framework/operator-sdk/version";
     23         in
     24         ''
     25           -ldflags=
     26             -X ${t}.GitVersion=${version}
     27             -X ${t}.KubernetesVersion=v1.17.2
     28         '';
     29 
     30       src = fetchFromGitHub {
     31         inherit rev;
     32         owner = "operator-framework";
     33         repo = "operator-sdk";
     34         sha256 = "${sha256}";
     35       };
     36       modSha256 = "${vendorSha256}";
     37 
     38       postInstall = ''
     39         # completions
     40         mkdir -p $out/share/bash-completion/completions/
     41         $out/bin/operator-sdk completion bash > $out/share/bash-completion/completions/operator-sdk
     42         mkdir -p $out/share/zsh/site-functions/
     43         $out/bin/operator-sdk completion zsh > $out/share/zsh/site-functions/_operator-sdk
     44       '';
     45 
     46       meta = {
     47         description = "SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding";
     48         homepage = https://github.com/operator-framework/operator-sdk;
     49         license = lib.licenses.asl20;
     50       };
     51     };
     52 
     53   operator-sdk_0_18 = makeOverridable operatorSdkGen {
     54     version = "0.18.0";
     55     sha256 = "1jbi5v1kcni740znjxm6hbpjx3a1zlkgnbnpsqbiljfi6k7spn6p";
     56     vendorSha256 = "08n6r0d7gqiysyl348l698blr7y9cxdmcadbmymzcya0fmczp0mv";
     57   };
     58   operator-sdk_0_19 = makeOverridable operatorSdkGen {
     59     version = "0.19.0";
     60     sha256 = "0prwdsxm8sldzdn7r9k1yw2q4asz90n25g4zcfaq23vs6fkxch9b";
     61     vendorSha256 = "0k6xrd1ahic89l821qvh3rr8k203ab6fmj7v4flkv889xaajjxb0";
     62   };
     63   operator-sdk_1_13 = makeOverridable operatorSdkGen {
     64     version = "1.13.0";
     65     sha256 = "107rkh11qql77i0ahgipfgih843zfrbvf1k7gfrmvp2avns98m3x";
     66     vendorSha256 = "1mvwrnik3mapghvi41zdxfd6d2d08hafnghypqqjwgdnin06bg98";
     67   };
     68   operator-sdk_1 = operator-sdk_1_13;
     69   operator-sdk = operator-sdk_1;
     70 }