Files
nixpkgs/pkgs/by-name/mq/mqttx/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

61 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchurl,
appimageTools,
imagemagick,
}:
let
pname = "mqttx";
version = "1.11.1";
suffixedUrl =
suffix:
"https://github.com/emqx/MQTTX/releases/download/v${version}/MQTTX-${version}${suffix}.AppImage";
sources = {
"aarch64-linux" = fetchurl {
url = suffixedUrl "-arm64";
hash = "sha256-gRR0gFHqIPXOrSytqERAi7msfrrYXm2xP84Jy+UhrKg=";
};
"x86_64-linux" = fetchurl {
url = suffixedUrl "";
hash = "sha256-rqzh4whp8NaeQb98mKTu+hL3RXQBEOKgvJKwLhzu+hg=";
};
};
src =
sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
appimageContents = appimageTools.extractType2 {
inherit pname version src;
};
in
appimageTools.wrapType2 {
inherit pname version src;
extraPkgs = pkgs: [ pkgs.xorg.libxshmfence ];
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/1024x1024/apps/${pname}.png
${imagemagick}/bin/convert ${appimageContents}/mqttx.png -resize 512x512 ${pname}_512.png
install -m 444 -D ${pname}_512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace-fail 'Exec=AppRun' 'Exec=${pname}'
'';
meta = {
description = "Powerful cross-platform MQTT 5.0 Desktop, CLI, and WebSocket client tools";
homepage = "https://mqttx.app/";
changelog = "https://github.com/emqx/MQTTX/releases/tag/v${version}";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ gaelreyrol ];
mainProgram = "mqttx";
};
}