pngpaste: refactor package.nix and hardcode repo.

pngpaste: switch to finalAttrs

pngpaste: simplify installPhase logic

Co-authored-by: Sam W <sam@wlcx.cc>
This commit is contained in:
Guy Chronister
2025-06-08 14:34:17 +00:00
co-authored by Sam W
parent 32e3db8294
commit 34a118f784
+9 -10
View File
@@ -4,22 +4,21 @@
fetchFromGitHub,
}:
let
stdenv.mkDerivation (finalAttrs: {
pname = "pngpaste";
version = "0.2.3";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "jcsalterego";
repo = pname;
rev = version;
repo = "pngpaste";
tag = finalAttrs.version;
sha256 = "uvajxSelk1Wfd5is5kmT2fzDShlufBgC0PDCeabEOSE=";
};
installPhase = ''
mkdir -p $out/bin
cp pngpaste $out/bin
runHook preInstall
install -Dm555 pngpaste $out/bin
runHook postInstall
'';
meta = {
@@ -32,9 +31,9 @@ stdenv.mkDerivation {
falling back to PNG.
'';
homepage = "https://github.com/jcsalterego/pngpaste";
changelog = "https://github.com/jcsalterego/pngpaste/raw/${version}/CHANGELOG.md";
changelog = "https://github.com/jcsalterego/pngpaste/raw/${finalAttrs.version}/CHANGELOG.md";
platforms = lib.platforms.darwin;
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ samw ];
};
}
})