about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ho
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-02-26 16:20:28 +0100
committerAlyssa Ross <hi@alyssa.is>2024-02-26 16:20:28 +0100
commit647438344bfc1f77791391e2b4f98eef865c63dc (patch)
treeef580867fc6cc413940e4330d939cf1afda082cb /nixpkgs/pkgs/by-name/ho
parentb084c6a0fab7f32c904c5c8e8db8dddcefbe507f (diff)
parente3474e1d1e53b70e2b2af73ea26d6340e82f6b8b (diff)
downloadnixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.gz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.bz2
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.lz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.xz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.zst
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.zip
Merge commit 'e3474e1d1e53'
Diffstat (limited to 'nixpkgs/pkgs/by-name/ho')
-rw-r--r--nixpkgs/pkgs/by-name/ho/hoppscotch/package.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ho/hoppscotch/package.nix b/nixpkgs/pkgs/by-name/ho/hoppscotch/package.nix
new file mode 100644
index 000000000000..3e6bf1ac190c
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/ho/hoppscotch/package.nix
@@ -0,0 +1,71 @@
+{ lib
+, stdenv
+, fetchurl
+, appimageTools
+, undmg
+, nix-update-script
+}:
+
+let
+  pname = "hoppscotch";
+  version = "23.12.5";
+
+  src = fetchurl {
+    aarch64-darwin = {
+      url = "https://github.com/hoppscotch/releases/releases/download/v${version}-1/Hoppscotch_mac_aarch64.dmg";
+      hash = "sha256-WUJW38vQ7o5KEmCxhVnJ03/f5tPOTYcczrEcmt6NSCY=";
+    };
+    x86_64-darwin = {
+      url = "https://github.com/hoppscotch/releases/releases/download/v${version}-1/Hoppscotch_mac_x64.dmg";
+      hash = "sha256-bQFD+9IoelinWYUndzbVvPNaRde6ACPvw9ifX9mYdno=";
+    };
+    x86_64-linux = {
+      url = "https://github.com/hoppscotch/releases/releases/download/v${version}-1/Hoppscotch_linux_x64.AppImage";
+      hash = "sha256-MYQ7SRm+CUPIXROZxejbbZ0/wH+U5DQO4YGbE/HQAj8=";
+    };
+  }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
+
+  meta = {
+    description = "Open source API development ecosystem";
+    homepage = "https://hoppscotch.com";
+    changelog = "https://github.com/hoppscotch/hoppscotch/releases/tag/${version}";
+    platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ DataHearth ];
+  };
+in
+if stdenv.isDarwin then stdenv.mkDerivation
+{
+  inherit pname version src 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 meta;
+
+  extraPkgs = pkgs:
+    appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;
+
+  extraInstallCommands =
+    let
+      appimageContents = appimageTools.extractType2 { inherit pname version src; };
+    in
+    ''
+      mv $out/bin/${pname}-${version} $out/bin/${pname}
+
+      # Install .desktop files
+      install -Dm444 ${appimageContents}/hoppscotch.desktop -t $out/share/applications
+      install -Dm444 ${appimageContents}/hoppscotch.png -t $out/share/pixmaps
+    '';
+}