Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kshlm committed Dec 31, 2024
1 parent 5fd9d29 commit ed8bedd
Showing 1 changed file with 34 additions and 38 deletions.
72 changes: 34 additions & 38 deletions pkgs/by-name/cy/cyphernetes/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,64 @@
nix-update-script,
pnpm,
stdenvNoCC,
...
}:
let
pname = "cyphernetes";
version = "0.14.0";
source = fetchFromGitHub {
src = fetchFromGitHub {
owner = "AvitalTamir";
repo = "cyphernetes";
rev = "v${version}";
tag = "v${version}";
hash = "sha256-rxZWI+2eWMNTjphxS+lsxAoZUXD8wWF1pfe6hLBxtuM=";
};

cyphernetes-web-ui =
let
src = source + "/web";
in
stdenvNoCC.mkDerivation {
inherit version src;
pname = pname + "-web";
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-3uOBSVA4oyPDj9GLiBSPQonalaSYveJ4II01GTfaAUw=";
};
nativeBuildInputs = [
nodejs
pnpm.configHook
];
buildPhase = ''
runHook preBuild
pnpm build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R dist/* $out/
runHook postInstall
'';
cyphernetes-web-ui = stdenvNoCC.mkDerivation {
inherit version src;
pname = "cyphernetes-web-ui";
sourceRoot = "${src.name}/web";

pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-3uOBSVA4oyPDj9GLiBSPQonalaSYveJ4II01GTfaAUw=";
};
nativeBuildInputs = [
nodejs
pnpm.configHook
];
buildPhase = ''
runHook preBuild
pnpm build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R dist/* $out/
runHook postInstall
'';
};
in
buildGoModule {
inherit pname version;
src = source;
inherit pname version src;
vendorHash = "sha256-DRzYgpHShZn+17R1Jj/arwAP5lyTpWelmwloUxT3n5Y=";
subPackages = [ "cmd/cyphernetes" ];
doCheck = false;
doCheck = false; # Tests need a kubeconfig with an active context configured
preBuild = ''
cp -r ${cyphernetes-web-ui} cmd/cyphernetes/web/
'';

meta = with lib; {
passthru.updateScript = nix-update-script { };

meta = {
homepage = "https://cyphernet.es/";
changelog = "https://github.com/AvitalTamir/cyphernetes/releases/tag/v${version}";
description = "A Kubernetes query language";
license = licenses.asl20;
maintainers = with maintainers; [
description = "Kubernetes query language";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
kshlm
stefankeidel
];
mainProgram = "cyphernetes";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};

passthru.updateScript = nix-update-script { };
}

0 comments on commit ed8bedd

Please sign in to comment.