Files
nixpkgs/pkgs/by-name/ho/hoppscotch/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

100 lines
2.7 KiB
Nix

{
lib,
stdenv,
fetchurl,
appimageTools,
undmg,
}:
let
pname = "hoppscotch";
version = "25.9.1-0";
src =
fetchurl
{
aarch64-darwin = {
url = "https://github.com/hoppscotch/releases/releases/download/v${version}/Hoppscotch_mac_aarch64.dmg";
hash = "sha256-mV/k+9NgHp9fyc8i0trewobvk3Fcu4JnRofHGV7dp70=";
};
x86_64-darwin = {
url = "https://github.com/hoppscotch/releases/releases/download/v${version}/Hoppscotch_mac_x64.dmg";
hash = "sha256-5UMZw3n7lINJSWf0SKmux7s8ISKGn+GppXbK1gcbeVs=";
};
x86_64-linux = {
url = "https://github.com/hoppscotch/releases/releases/download/v${version}/Hoppscotch_linux_x64.AppImage";
hash = "sha256-aW83wSbIV31sakiZxOaUd2QjxOwK2tcnaEMF9jrvrHg=";
};
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
passthru.updateScript = ./update.sh;
meta = {
description = "Open source API development ecosystem";
longDescription = ''
Hoppscotch is a lightweight, web-based API development suite. It was built
from the ground up with ease of use and accessibility in mind providing
all the functionality needed for API developers with minimalist,
unobtrusive UI.
'';
homepage = "https://hoppscotch.com";
downloadPage = "https://hoppscotch.com/downloads";
changelog = "https://github.com/hoppscotch/hoppscotch/releases/tag/20${lib.head (lib.splitString "-" version)}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ DataHearth ];
mainProgram = "hoppscotch";
platforms = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
in
if stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
passthru
meta
;
sourceRoot = ".";
nativeBuildInputs = [ undmg ];
installPhase = ''
runHook preInstall
mkdir -p "$out/Applications"
mv Hoppscotch.app $out/Applications/
runHook postInstall
'';
}
else
appimageTools.wrapType2 {
inherit
pname
version
src
passthru
meta
;
extraInstallCommands =
let
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
''
# Install .desktop files
install -Dm444 ${appimageContents}/Hoppscotch.desktop $out/share/applications/hoppscotch.desktop
install -Dm444 ${appimageContents}/Hoppscotch.png $out/share/pixmaps/hoppscotch.png
substituteInPlace $out/share/applications/hoppscotch.desktop \
--replace-fail "hoppscotch-desktop" "hoppscotch"
'';
}