commit 8a3e7dd9da88385d48c906b34460b6a07dd18ce1
parent 3b48b8b22ab2a508ee593a3c5e06bed31fa553cf
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 17 Oct 2022 15:00:53 +0200
Migrate openshift packages to an overlay
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
8 files changed, 5 insertions(+), 471 deletions(-)
diff --git a/flake.nix b/flake.nix
@@ -40,6 +40,9 @@
nixos-wsl = { type = "github"; owner = "nix-community"; repo = "NixOS-WSL"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-hardware = { type = "github"; owner = "NixOS"; "repo" = "nixos-hardware"; };
+ # Red Hat
+ chapeau-rouge = { type = "github"; owner = "vdemeester"; repo = "chapeau-rouge"; };
+
# Channels
# FIXME: is it needed or should I just alias nixos-unstable instead
nixpkgs = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "nixos-unstable"; };
@@ -56,6 +59,7 @@
, home-manager
, home-manager-22_05
, emacs-overlay
+ , chapeau-rouge
, nur
, sops-nix
, envfs
@@ -102,12 +106,12 @@
channelsConfig.allowUnfree = true;
sharedOverlays = [
- (import ./nix/overlays).openshift
(import ./nix/overlays).tekton
(import ./nix/overlays/sbr.nix)
emacs-overlay.overlay
nur.overlay
devshell.overlay
+ chapeau-rouge.overlays.openshift
];
hostDefaults = {
diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix
@@ -1,5 +1,4 @@
{
- openshift = final: prev: { };
tekton = final: prev: {
inherit (prev.callPackage ../packages/tkn { })
diff --git a/nix/packages/default.nix b/nix/packages/default.nix
@@ -40,43 +40,6 @@ rec {
toolbox = pkgs.callPackage ./toolbox { };
yaspell = pkgs.callPackage ./yaspell { };
- # OpenShift
- inherit (pkgs.callPackage ./openshift/oc.nix { })
- oc_4_1
- oc_4_2
- oc_4_3
- oc_4_4
- oc_4_5
- oc_4_6
- oc_4_7
- oc_4_8
- oc_4_9
- oc_4_10
- oc_4_11
- oc
- ;
- inherit (pkgs.callPackage ./openshift/openshift-install.nix { })
- openshift-install_4_3
- openshift-install_4_4
- openshift-install_4_5
- openshift-install_4_6
- openshift-install_4_7
- openshift-install_4_8
- openshift-install_4_9
- openshift-install_4_10
- openshift-install_4_11
- openshift-install
- ;
-
- inherit (pkgs.callPackage ./openshift/odo.nix { })
- odo_1_2
- odo_2_0
- odo_2_1
- odo_2_2
- odo_2_3
- odo
- ;
-
inherit (pkgs.callPackage ./kam { })
kam_1_1
kam
@@ -84,28 +47,6 @@ rec {
operator-tool = pkgs.callPackage ./operator-tooling { };
- # Operator SDK
- inherit (pkgs.callPackage ./operator-sdk { })
- operator-sdk_1
- operator-sdk_1_23
- operator-sdk_1_22
- operator-sdk_1_21
- operator-sdk_1_20
- operator-sdk_1_17
- operator-sdk_1_16
- operator-sdk_1_15
- operator-sdk_1_14
- operator-sdk_1_13
- operator-sdk_0_18
- operator-sdk_0_19
- operator-sdk
- ;
- # OPM
- inherit (pkgs.callPackage ./operator-sdk/opm.nix { })
- opm_1_26
- opm
- ;
-
# Tekton
inherit (pkgs.callPackage ./tkn { })
tkn_0_17
diff --git a/nix/packages/openshift/oc.nix b/nix/packages/openshift/oc.nix
@@ -1,86 +0,0 @@
-{ stdenv, lib, fetchurl }:
-
-with lib;
-rec {
- ocGen =
- { version
- , sha256
- }:
-
- stdenv.mkDerivation rec {
- pname = "oc";
- name = "${pname}-${version}";
-
- src = fetchurl {
- url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-client-linux-${version}.tar.gz";
- sha256 = "${sha256}";
- };
-
- phases = " unpackPhase installPhase fixupPhase ";
-
- unpackPhase = ''
- runHook preUnpack
- mkdir ${name}
- tar -C ${name} -xzf $src
- '';
-
- installPhase = ''
- runHook preInstall
- install -D ${name}/oc $out/bin/oc
- patchelf \
- --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
- $out/bin/oc
- # completions
- mkdir -p $out/share/bash-completion/completions/
- $out/bin/oc completion bash > $out/share/bash-completion/completions/oc
- mkdir -p $out/share/zsh/site-functions
- $out/bin/oc completion zsh > $out/share/zsh/site-functions/_oc
- '';
- };
-
- oc = oc_4_11;
- oc_4_11 = makeOverridable ocGen {
- version = "4.11.2";
- sha256 = "sha256-7uCRjf8oo+CIcuSJOvSunrzo8uzoJEWytypXzbAOvm4=";
- };
- oc_4_10 = makeOverridable ocGen {
- version = "4.10.30";
- sha256 = "sha256-hYlzGgE6MZCfRZpf/1+hv2YbSnmSyqNSsWqt5JC76ps=";
- };
- oc_4_9 = makeOverridable ocGen {
- version = "4.9.47";
- sha256 = "sha256-jNwZHfGprFS+wU5xfnh0bpI+lNJR/xUbsOlG3Urk2O8=";
- };
- oc_4_8 = makeOverridable ocGen {
- version = "4.8.48";
- sha256 = "sha256-M7dwAbYayKNCjkciSoYzv+UwpX+IL6i03hKMBeUVpXY=";
- };
- oc_4_7 = makeOverridable ocGen {
- version = "4.7.56";
- sha256 = "sha256-RKYFW4ir6Gd5GDAGJ/pY4/ysSgGxTCndslvr0VmxgmE=";
- };
- oc_4_6 = makeOverridable ocGen {
- version = "4.6.50";
- sha256 = "sha256-tkbLQHzT2AnkYqpfwGH30uFIuijwlrHsBCiKLGA0gMI=";
- };
- oc_4_5 = makeOverridable ocGen {
- version = "4.5.41";
- sha256 = "01m7iak83md7y1nfdywizr5sxk3kd8543ahzqh2ncj9sqmjraw0r";
- };
- oc_4_4 = makeOverridable ocGen {
- version = "4.4.33";
- sha256 = "1bf34331c7wixb1kmabp93sdpp4ihlyigx7nhmy71ffp7j82n419";
- };
- oc_4_3 = makeOverridable ocGen {
- version = "4.3.40";
- sha256 = "04dkmw78dwniyjdvqyig7hafcicrn2ixg6bvqsy1y2plm0gsjmbz";
- };
- oc_4_2 = makeOverridable ocGen {
- version = "4.2.36";
- sha256 = "1f9h58mx0a3zhpx11gim13hd3m4yzwa6ipbp1gwlghmhjz1jh35v";
- };
- oc_4_1 = makeOverridable ocGen {
- version = "4.1.41";
- sha256 = "06wphg4vddhvavhxn07iq6pi3gq7ljbcdsgldwhyrjy8gx50bp47";
- };
-}
diff --git a/nix/packages/openshift/odo.nix b/nix/packages/openshift/odo.nix
@@ -1,62 +0,0 @@
-{ stdenv, lib, fetchurl }:
-
-with lib;
-rec {
- odoGen =
- { version
- , sha256
- }:
-
- stdenv.mkDerivation rec {
- pname = "odo";
- name = "${pname}-${version}";
-
- src = fetchurl {
- url = "https://mirror.openshift.com/pub/openshift-v4/clients/odo/v${version}/odo-linux-amd64.tar.gz";
- sha256 = "${sha256}";
- };
-
- phases = " unpackPhase installPhase fixupPhase ";
-
- unpackPhase = ''
- runHook preUnpack
- mkdir ${name}
- tar -C ${name} -xzf $src
- '';
-
- installPhase = ''
- runHook preInstall
- install -D ${name}/odo $out/bin/odo
- patchelf \
- --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
- $out/bin/odo
- # completions
- mkdir -p $out/share/bash-completion/completions/
- $out/bin/odo utils terminal bash > $out/share/bash-completion/completions/odo
- mkdir -p $out/share/zsh/site-functions
- $out/bin/odo utils terminal zsh > $out/share/zsh/site-functions/_odo
- '';
- };
-
- odo = odo_2_3;
- odo_2_3 = makeOverridable odoGen {
- version = "2.3.1";
- sha256 = "13frxa5mf52j08mica4j9v6zdrqxhccx0injz860fywbcsz0x67p";
- };
- odo_2_2 = makeOverridable odoGen {
- version = "2.2.4";
- sha256 = "1ma0q79s85dy23b4ygjm67dm05i7clm39h5p86sdz4wz63amiqcg";
- };
- odo_2_1 = makeOverridable odoGen {
- version = "2.1.0";
- sha256 = "1jy79wg7war7i1hnlnzxcs2nj81r5zyk9sr2vc6knwxjg5cllis6";
- };
- odo_2_0 = makeOverridable odoGen {
- version = "2.0.7";
- sha256 = "05mxdxy8llava10sq9b111xq2bd5ywlw80s3zkwk8nzikhjjfvg3";
- };
- odo_1_2 = makeOverridable odoGen {
- version = "1.2.6";
- sha256 = "0dhnc413sgymwy8df27diz7bkpkckgm6jws88na4mg82jffnyn1w";
- };
-}
diff --git a/nix/packages/openshift/openshift-install.nix b/nix/packages/openshift/openshift-install.nix
@@ -1,81 +0,0 @@
-{ stdenv, lib, fetchurl }:
-
-with lib;
-rec {
- openshiftInstallGen =
- { version
- , sha256
- }:
-
- stdenv.mkDerivation rec {
- pname = "openshift-install";
- name = "${pname}-${version}";
-
- src = fetchurl {
- inherit sha256;
- url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-install-linux-${version}.tar.gz";
- };
-
- phases = " unpackPhase installPhase fixupPhase ";
-
- unpackPhase = ''
- runHook preUnpack
- mkdir ${name}
- tar -C ${name} -xzf $src
- '';
-
- installPhase = ''
- runHook preInstall
- install -D ${name}/openshift-install $out/bin/openshift-install
- # completions
- mkdir -p $out/share/bash-completion/completions/
- $out/bin/openshift-install completion bash > $out/share/bash-completion/completions/openshift-install
- #mkdir -p $out/share/zsh/site-functions
- #$out/bin/openshift-install completion zsh > $out/share/zsh/site-functions/_openshift-install
- '';
-
- meta = {
- description = "Install an OpenShift cluster";
- homepage = https://github.com/openshift/installer;
- license = lib.licenses.asl20;
- };
- };
-
- openshift-install = openshift-install_4_11;
- openshift-install_4_11 = makeOverridable openshiftInstallGen {
- version = "4.11.2";
- sha256 = "sha256-WbV8O4ovOvCVyplDZHkLPM4vh9fH2e0dgIIJzOCDTt4=";
- };
- openshift-install_4_10 = makeOverridable openshiftInstallGen {
- version = "4.10.30";
- sha256 = "sha256-EzgFJAf91I+SjyIKdhlHQR7ET22xi/wzHRFCau5Y+TY=";
- };
- openshift-install_4_9 = makeOverridable openshiftInstallGen {
- version = "4.9.47";
- sha256 = "sha256-dgxl1syjyzcY6Z/W0qzHe3/GIj4niD+Epx0DFofw7tY=";
- };
- openshift-install_4_8 = makeOverridable openshiftInstallGen {
- version = "4.8.48";
- sha256 = "sha256-Vsoa5mg21epGQRKvOEA/qIyVNqc9QPMmKlY9DZ5J2wQ=";
- };
- openshift-install_4_7 = makeOverridable openshiftInstallGen {
- version = "4.7.56";
- sha256 = "sha256-f0SmZewcHIqrQr5IZ4oxhT5LfcyHMejA/wI+AoI09d0=";
- };
- openshift-install_4_6 = makeOverridable openshiftInstallGen {
- version = "4.6.50";
- sha256 = "sha256-NM3FIe6d2iPlRSZElklhD7dF2LnxYdzEkTCNpTaCHnQ=";
- };
- openshift-install_4_5 = makeOverridable openshiftInstallGen {
- version = "4.5.41";
- sha256 = "1356q49bhl0bkqspalh2xymma8rlr5v8xdcfmhflisim930iimw3";
- };
- openshift-install_4_4 = makeOverridable openshiftInstallGen {
- version = "4.4.33";
- sha256 = "1mdjccyz4wbcwvg4ax2wr3x52cx5h8a0i25n1a7aawsni6z5261m";
- };
- openshift-install_4_3 = makeOverridable openshiftInstallGen {
- version = "4.3.40";
- sha256 = "02in21q7d2bazrgkksk0vy2rflxqssayjjlz43k65cnrk8nnv1sm";
- };
-}
diff --git a/nix/packages/operator-sdk/default.nix b/nix/packages/operator-sdk/default.nix
@@ -1,121 +0,0 @@
-{ stdenv, lib, buildGo117Module, git, fetchFromGitHub }:
-
-with lib;
-rec {
- operatorSdkGen =
- { version
- , k8sVersion
- , sha256
- , vendorSha256
- }:
-
- buildGo117Module rec {
- inherit vendorSha256;
- pname = "operator-sdk";
- name = "${pname}-${version}";
- rev = "v${version}";
-
- builtInputs = [ "git" ];
-
- subPackages = [ "cmd/operator-sdk" ];
- ldflags =
- let
- t = "github.com/operator-framework/operator-sdk/internal/version";
- in
- [
- "-X ${t}.GitVersion=${version}"
- "-X ${t}.KubernetesVersion=${k8sVersion}"
- ];
-
- src = fetchFromGitHub {
- inherit rev;
- owner = "operator-framework";
- repo = "operator-sdk";
- sha256 = "${sha256}";
- };
- modSha256 = "${vendorSha256}";
-
- postInstall = ''
- # completions
- mkdir -p $out/share/bash-completion/completions/
- $out/bin/operator-sdk completion bash > $out/share/bash-completion/completions/operator-sdk
- mkdir -p $out/share/zsh/site-functions/
- $out/bin/operator-sdk completion zsh > $out/share/zsh/site-functions/_operator-sdk
- '';
-
- meta = {
- description = "SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding";
- homepage = https://github.com/operator-framework/operator-sdk;
- license = lib.licenses.asl20;
- };
- };
-
- operator-sdk_0_18 = makeOverridable operatorSdkGen {
- version = "0.18.0";
- k8sVersion = "v1.17.2";
- sha256 = "1jbi5v1kcni740znjxm6hbpjx3a1zlkgnbnpsqbiljfi6k7spn6p";
- vendorSha256 = "08n6r0d7gqiysyl348l698blr7y9cxdmcadbmymzcya0fmczp0mv";
- };
- operator-sdk_0_19 = makeOverridable operatorSdkGen {
- version = "0.19.0";
- k8sVersion = "v1.17.2";
- sha256 = "0prwdsxm8sldzdn7r9k1yw2q4asz90n25g4zcfaq23vs6fkxch9b";
- vendorSha256 = "0k6xrd1ahic89l821qvh3rr8k203ab6fmj7v4flkv889xaajjxb0";
- };
- operator-sdk_1_13 = makeOverridable operatorSdkGen {
- version = "1.13.0";
- k8sVersion = "v1.21";
- sha256 = "107rkh11qql77i0ahgipfgih843zfrbvf1k7gfrmvp2avns98m3x";
- vendorSha256 = "1mvwrnik3mapghvi41zdxfd6d2d08hafnghypqqjwgdnin06bg98";
- };
- operator-sdk_1_14 = makeOverridable operatorSdkGen {
- version = "1.14.0";
- k8sVersion = "v1.21";
- sha256 = "sha256-fLOCRg37YwRZwhQwMz6NSD/byYCZPu9+RZUqQbB9uBM=";
- vendorSha256 = "sha256:1dgpc718nxgzn048q08in5cxjf1cya57a3pgykg96092pnh01n79";
- };
- operator-sdk_1_15 = makeOverridable operatorSdkGen {
- version = "1.15.0";
- k8sVersion = "v1.21";
- sha256 = "sha256-8RWo+9XJrO/CU5vcnjzt0u2vbMmgP0aCa3iIZFEU50c=";
- vendorSha256 = "sha256:1dgpc718nxgzn048q08in5cxjf1cya57a3pgykg96092pnh01n79";
- };
- operator-sdk_1_16 = makeOverridable operatorSdkGen {
- version = "1.16.0";
- k8sVersion = "v1.21";
- sha256 = "sha256-gjeDH7nXsgiscvFa/3IUPdkHEiyA8DwlN3FXkhIGnzc=";
- vendorSha256 = "sha256:19cf9gifq9zxxbh67m3czc5fdz9m3fxa3ddjip10svn89n38mmm0";
- };
- operator-sdk_1_17 = makeOverridable operatorSdkGen {
- version = "1.17.0";
- k8sVersion = "v1.21";
- sha256 = "sha256-zgiJDmpjmm2rzi12XAT+bHpiOKwi1k6xd9fvPGwFNXQ=";
- vendorSha256 = "sha256:0i74v34ckawxq9r31v1jj3vyp8rp9v3jyfp0pfn896j24ka85dlr";
- };
- operator-sdk_1_20 = makeOverridable operatorSdkGen {
- version = "1.20.1";
- k8sVersion = "1.23";
- sha256 = "sha256-Rt5F+Zc1BrxKBaQPMtJoeZWkEK/OmmGjM0iG4xzNqdQ=";
- vendorSha256 = "sha256-YwFJBqvfm+cw4FTNORmsNp1W39bnTT+g7EvNOOBhkqA=";
- };
- operator-sdk_1_21 = makeOverridable operatorSdkGen {
- version = "1.22.0";
- k8sVersion = "1.23";
- sha256 = "sha256-RrbO30LVRj5Rg91eXHdsU2yoUeUF7talhawH22Il7KQ=";
- vendorSha256 = "sha256-2C3ToNPwF4Ruq8xjfyCNz/Zbh1CVQZWUh0WXEgIjhdM=";
- };
- operator-sdk_1_22 = makeOverridable operatorSdkGen {
- version = "1.22.2";
- k8sVersion = "1.24";
- sha256 = "sha256-SpSdVJeN+rOZ6jeFPKadXKQLBZmrLjbrBrJsK9zDiZg=";
- vendorSha256 = "sha256-MiA3XbdSwzZLilvrqlNU8e2nMAfhmVnNeG1oUx4ISRU=";
- };
- operator-sdk_1_23 = makeOverridable operatorSdkGen {
- version = "1.23.0";
- k8sVersion = "1.24";
- sha256 = "sha256-2/zXdhRp8Q7e9ty0Zp+fpmcLNW6qfrW6ND83sypx9Xw=";
- vendorSha256 = "sha256-3/kU+M+oKaPJkqMNuvd1ANlHRnXhaUrofj/rl3CS5Ao=";
- };
- operator-sdk_1 = operator-sdk_1_22;
- operator-sdk = operator-sdk_1;
-}
diff --git a/nix/packages/operator-sdk/opm.nix b/nix/packages/operator-sdk/opm.nix
@@ -1,60 +0,0 @@
-{ stdenv, lib, buildGo117Module, git, fetchFromGitHub }:
-
-with lib;
-rec {
- opmGen =
- { version
- , sha256
- , vendorSha256
- }:
-
- buildGo117Module rec {
- inherit vendorSha256;
- pname = "opm";
- name = "${pname}-${version}";
- rev = "v${version}";
-
- builtInputs = [ "git" ];
-
- subPackages = [ "cmd/opm" ];
- ldflags =
- let
- t = "github.com/operator-framework/operator-registry/cmd/opm/version";
- in
- [
- "-X ${t}.gitCommit=${version}"
- "-X ${t}.opmVersion=${version}"
- ];
- tags = [ "json1" ];
-
- src = fetchFromGitHub {
- inherit rev;
- owner = "operator-framework";
- repo = "operator-registry";
- sha256 = "${sha256}";
- };
-
- postInstall = ''
- # completions
- mkdir -p $out/share/bash-completion/completions/
- $out/bin/opm completion bash > $out/share/bash-completion/completions/opm
- mkdir -p $out/share/zsh/site-functions/
- $out/bin/opm completion zsh > $out/share/zsh/site-functions/_opm
- '';
-
- meta = {
- description = "Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager.
-
-";
- homepage = https://github.com/operator-framework/operator-registry;
- license = lib.licenses.asl20;
- };
- };
-
- opm_1_26 = makeOverridable opmGen {
- version = "1.26.0";
- sha256 = "sha256-wOdHduHcuH5olPGwpV6v4wSTxZYZbkzwDGknQVGPQvI=";
- vendorSha256 = null;
- };
- opm = opm_1_26;
-}