nixpkgs/pkgs/development/tools/altair-graphql-client/default.nix
Peder Bergebakken Sundt 985aa8174d treewide: unbreak appimageTools.wrapType2 builds
`appimageTools.wrapType2` no longer creates a binary `$out/bin/${name}` if `pname` and `version` is provided.
Derivations that have worked around this behavior with a `mv $out/bin/{${name},${pname}}` broke as a result.
This should fix most instances.

contex: #271071
2024-04-24 15:26:52 +02:00

37 lines
1.2 KiB
Nix

{ lib, appimageTools, makeWrapper, fetchurl }:
let
pname = "altair";
version = "6.4.0";
src = fetchurl {
url = "https://github.com/imolorhe/altair/releases/download/v${version}/altair_${version}_x86_64_linux.AppImage";
sha256 = "sha256-eUUPfMwCMrMHk2RcLfpI8VuolgI/7geY6/6QrWjkIXg=";
};
appimageContents = appimageTools.extract { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit src pname version;
extraInstallCommands = ''
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
meta = with lib; {
description = "A feature-rich GraphQL Client IDE";
mainProgram = "altair";
homepage = "https://github.com/imolorhe/altair";
license = licenses.mit;
maintainers = with maintainers; [ evalexpr ];
platforms = [ "x86_64-linux" ];
};
}