From 06f1086c5b78e438dc4772c35abaeaf7840ad8ef Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:02:42 -0300 Subject: [PATCH] ceph-csi: refactor - migrate sha256 to hash - add install runHook - order derivation by phases order, attrs by alphabetical order - enable strictDeps - meta: add changelog, downloadPage, remove nested with --- pkgs/by-name/ce/ceph-csi/package.nix | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ce/ceph-csi/package.nix b/pkgs/by-name/ce/ceph-csi/package.nix index 5d0a4c5a53a9..3539e6f043a4 100644 --- a/pkgs/by-name/ce/ceph-csi/package.nix +++ b/pkgs/by-name/ce/ceph-csi/package.nix @@ -1,34 +1,41 @@ -{ stdenv, lib, go, ceph, fetchFromGitHub }: +{ ceph, fetchFromGitHub, go, lib, stdenv }: stdenv.mkDerivation rec { pname = "ceph-csi"; version = "3.11.0"; - nativeBuildInputs = [ go ]; - buildInputs = [ ceph ]; - src = fetchFromGitHub { owner = "ceph"; repo = "ceph-csi"; rev = "v${version}"; - sha256 = "sha256-EgHl74kJ6lTS3pqz/Hxh/2tpc1xiDNcJxzERwKops+A="; + hash = "sha256-EgHl74kJ6lTS3pqz/Hxh/2tpc1xiDNcJxzERwKops+A="; }; preConfigure = '' export GOCACHE=$(pwd)/.cache ''; + strictDeps = true; + + nativeBuildInputs = [ go ]; + + buildInputs = [ ceph ]; + installPhase = '' + runHook preInstall mkdir -p $out/bin cp ./_output/* $out/bin + runHook postInstall ''; - meta = with lib; { - homepage = "https://ceph.com/"; + meta = { description = "Container Storage Interface (CSI) driver for Ceph RBD and CephFS"; + downloadPage = "https://github.com/ceph/ceph-csi"; + changelog = "https://github.com/ceph/ceph-csi/releases/tag/v${version}"; + homepage = "https://ceph.com/"; + license = lib.licenses.asl20; mainProgram = "cephcsi"; - license = [ licenses.asl20 ]; - maintainers = with maintainers; [ johanot ]; + maintainers = with lib.maintainers; [ johanot ]; platforms = [ "x86_64-linux" "aarch64-linux" ]; }; }