Skip to content

Commit

Permalink
Add omc package :)
Browse files Browse the repository at this point in the history
omc is an OpenShift Must-gather Client :)

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Jul 27, 2023
1 parent 024919b commit 21463f5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
6 changes: 6 additions & 0 deletions overlays/openshift.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ in
# master based build
# opm-git
;
# omc
inherit (super.callPackage ../packages/omc.nix { })
omc
omc_3_2
omc-git
;
# operator-tool(ing) = …
# opc
inherit (super.callPackage ../packages/opc.nix { })
Expand Down
72 changes: 72 additions & 0 deletions packages/omc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{ stdenv, lib, buildGo119Module, fetchFromGitHub }:

with lib;
rec {
omcGen =
{ version
, sha256
, rev ? "v${version}"
}:
buildGo119Module rec {
pname = "omc";
name = "${pname}-${version}";

#subPackages = [ "." ];
ldflags =
let
t = "github.com/gmeghnag/omc/vars";
in
[
"-s"
"-w"
"-X ${t}.OMCVersionTag=${version}"
# -X github.com/gmeghnag/omc/vars.OMCVersionHash=${HASH}"
];

src = fetchFromGitHub {
inherit rev;
owner = "gmeghnag";
repo = "omc";
sha256 = "${sha256}";
};
vendorSha256 = null;

doCheck = false;
preBuild = ''
export HOME=$(pwd)
'';
preInstall = ''
pwd
ls -la .
'';
postInstall = ''
# completions
mkdir -p $out/share/bash-completion/completions/
$out/bin/omc completion bash > $out/share/bash-completion/completions/omc
mkdir -p $out/share/zsh/site-functions/
$out/bin/omc completion zsh > $out/share/zsh/site-functions/omc
'';

meta = {
description = "OpenShift Must-Gather Client";
homepage = "https://github.com/gmeghnag/omc";
license = lib.licenses.asl20;
};
};

omc_3_2 = makeOverridable omcGen {
version = "3.2.0";
sha256 = "sha256-GBfRjS8u+KKBLie2GmzeLbD08V/LKNF7cbC7fjMxUtw=";
};
omc = omc_3_2;

omc-git =
let
repoMeta = importJSON ../repos/omc-main.json;
in
makeOverridable omcGen {
version = "${repoMeta.version}";
rev = "${repoMeta.rev}";
sha256 = "${repoMeta.sha256}";
};
}
1 change: 1 addition & 0 deletions repos/omc-main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "github", "owner": "gmeghnag", "repo": "omc", "rev": "3b3daed3641108a556df4d39533c189603131a6a", "sha256": "1p2j64rpxfxhf5xx2a6bbzqz9c1dvrn1mdi75s0s5y1f5y6x25qq", "version": "20230726.0"}
1 change: 1 addition & 0 deletions repos/update
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function update_openshift_mirror() {

update_github_repo openshift oc master
update_github_repo openshift-pipelines opc main
update_github_repo gmeghnag omc main

update_openshift_mirror oc openshift-client
update_openshift_mirror openshift-install openshift-install

0 comments on commit 21463f5

Please sign in to comment.