From 2c85f9ecaa32eeefe20930ffb15fcce04574b7a5 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 12 May 2023 10:30:12 +0300 Subject: [PATCH] angelfish: rework how cargo hashes are handled This should simplify future updates. --- pkgs/applications/kde/angelfish.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/kde/angelfish.nix b/pkgs/applications/kde/angelfish.nix index 45cfcad67d8e..7647173f2f5f 100644 --- a/pkgs/applications/kde/angelfish.nix +++ b/pkgs/applications/kde/angelfish.nix @@ -19,26 +19,17 @@ , rustPlatform , srcs -# These must be updated in tandem with package updates. -, cargoShaForVersion ? "23.04.0" -, cargoSha256 ? "sha256-96Qe8zdLZdOrU/t6J+JJ6V0PXyFOnJF18qDrk4PZGsA=" +# provided as callPackage input to enable easier overrides through overlays +, cargoSha256 ? "sha256-whMfpElpFB7D+dHHJrbwINFL4bVpHTlcZX+mdBfiqEE=" }: -# Guard against incomplete updates. -# Values are provided as callPackage inputs to enable easier overrides through overlays. -if cargoShaForVersion != srcs.angelfish.version -then builtins.throw '' - angelfish package update is incomplete. - Hash for cargo dependencies is declared for version ${cargoShaForVersion}, but we're building ${srcs.angelfish.version}. - Update the cargoSha256 and cargoShaForVersion for angelfish. -'' else - mkDerivation rec { pname = "angelfish"; cargoDeps = rustPlatform.fetchCargoTarball { - src = srcs.angelfish.src; + # include version in the name so we invalidate the FOD name = "${pname}-${srcs.angelfish.version}"; + inherit (srcs.angelfish) src; sha256 = cargoSha256; };