Files
nixpkgs/pkgs/by-name/qu/quba/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
1.8 KiB
Nix

{
lib,
stdenvNoCC,
appimageTools,
fetchurl,
_7zz,
}:
let
pname = "quba";
version = "1.4.2";
meta = {
description = "Viewer for electronic invoices";
homepage = "https://github.com/ZUGFeRD/quba-viewer";
downloadPage = "https://github.com/ZUGFeRD/quba-viewer/releases";
license = lib.licenses.asl20;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ onny ];
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
};
src = fetchurl {
url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}.AppImage";
hash = "sha256-3goMWN5GeQaLJimUKbjozJY/zJmqc9Mvy2+6bVSt1p0=";
};
appimageContents = appimageTools.extractType1 { inherit pname version src; };
linux = appimageTools.wrapType1 {
inherit
pname
version
src
meta
;
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/quba.desktop -t $out/share/applications
substituteInPlace $out/share/applications/quba.desktop \
--replace-fail 'Exec=AppRun' 'Exec=quba'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
};
darwin = stdenvNoCC.mkDerivation {
inherit pname version meta;
src = fetchurl {
url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}-universal.dmg";
hash = "sha256-q7va2D9AT0BoPhfkub/RFQxGyF12uFaCDpSYIxslqMc=";
};
unpackCmd = "7zz x -bd -osource -xr'!*/Applications' -xr'!*com.apple.provenance' $curSrc";
nativeBuildInputs = [ _7zz ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
mv Quba.app $out/Applications
runHook postInstall
'';
};
in
if stdenvNoCC.hostPlatform.isLinux then linux else darwin