nixpkgs/pkgs/tools/misc/flexoptix-app/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, appimageTools, fetchurl, nodePackages }: let
2021-04-17 19:33:31 +03:00
pname = "flexoptix-app";
2022-08-28 16:06:14 +03:00
version = "5.12.2";
2021-04-17 19:33:31 +03:00
src = fetchurl {
2022-08-12 15:57:23 +03:00
name = "${pname}-${version}.AppImage";
2021-04-17 19:33:31 +03:00
url = "https://flexbox.reconfigure.me/download/electron/linux/x64/FLEXOPTIX%20App.${version}.AppImage";
2022-08-28 16:06:14 +03:00
hash = "sha256-XVswjIXnuWLRiXFc38lDhSvxYTQtYjs4V/AGdiNLX0g=";
2021-04-17 19:33:31 +03:00
};
udevRules = fetchurl {
url = "https://www.flexoptix.net/skin/udev_rules/99-tprogrammer.rules";
2022-06-03 03:49:34 +03:00
hash = "sha256-OZe5dV50xq99olImbo7JQxPjRd7hGyBIVwFvtR9cIVc=";
2021-04-17 19:33:31 +03:00
};
2022-08-12 15:57:23 +03:00
appimageContents = (appimageTools.extract { inherit pname version src; }).overrideAttrs (oA: {
buildCommand = ''
${oA.buildCommand}
# Get rid of the autoupdater
${nodePackages.asar}/bin/asar extract $out/resources/app.asar app
sed -i 's/async isUpdateAvailable.*/async isUpdateAvailable(updateInfo) { return false;/g' app/node_modules/electron-updater/out/AppUpdater.js
${nodePackages.asar}/bin/asar pack app $out/resources/app.asar
'';
});
2021-04-17 19:33:31 +03:00
in appimageTools.wrapAppImage {
2022-08-12 15:57:23 +03:00
inherit pname version;
src = appimageContents;
2021-04-17 19:33:31 +03:00
multiPkgs = null; # no 32bit needed
extraPkgs = { pkgs, ... }@args: [
pkgs.hidapi
] ++ appimageTools.defaultFhsEnvArgs.multiPkgs args;
extraInstallCommands = ''
# Add desktop convencience stuff
2022-08-12 15:57:23 +03:00
mv $out/bin/{${pname}-*,${pname}}
2021-04-17 19:33:31 +03:00
install -Dm444 ${appimageContents}/flexoptix-app.desktop -t $out/share/applications
install -Dm444 ${appimageContents}/flexoptix-app.png -t $out/share/pixmaps
substituteInPlace $out/share/applications/flexoptix-app.desktop \
--replace 'Exec=AppRun' "Exec=$out/bin/${pname} --"
# Add udev rules
2021-04-17 19:33:31 +03:00
mkdir -p $out/lib/udev/rules.d
ln -s ${udevRules} $out/lib/udev/rules.d/99-tprogrammer.rules
'';
meta = {
description = "Configure FLEXOPTIX Universal Transcievers in seconds";
homepage = "https://www.flexoptix.net";
changelog = "https://www.flexoptix.net/en/flexoptix-app/?os=linux#flexapp__modal__changelog";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ das_j ];
platforms = [ "x86_64-linux" ];
};
}