From 1ac2d6141ca60b413b52ae2e800bac25b4f32b75 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Fri, 11 Jun 2021 15:25:32 +0200 Subject: [PATCH] mathpix-snipping-tool: init at 03.00.0025 --- .../misc/mathpix-snipping-tool/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/tools/misc/mathpix-snipping-tool/default.nix diff --git a/pkgs/tools/misc/mathpix-snipping-tool/default.nix b/pkgs/tools/misc/mathpix-snipping-tool/default.nix new file mode 100644 index 000000000000..7e940ee4f77f --- /dev/null +++ b/pkgs/tools/misc/mathpix-snipping-tool/default.nix @@ -0,0 +1,31 @@ +{ appimageTools, lib, fetchurl }: +let + pname = "mathpix-snipping-tool"; + version = "03.00.0025"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://download.mathpix.com/linux/Mathpix_Snipping_Tool-x86_64.v${version}.AppImage"; + sha256 = "0p39rsmjfz3m5s3k9pmmkqbp8f21s1cwjgspz8m47dq5jjls8ay8"; + }; + + appimageContents = appimageTools.extract { inherit name src; }; +in appimageTools.wrapType2 { + inherit name src; + + extraInstallCommands = '' + mv $out/bin/${name} $out/bin/${pname} + + install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications + + cp -r ${appimageContents}/usr/share/icons $out/share + ''; + + meta = with lib; { + description = "OCR tool to convert pictures to LaTeX."; + homepage = "https://mathpix.com/"; + license = licenses.unfree; + maintainers = [ maintainers.hiro98 ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ef91641dd587..f03279bf416b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6311,6 +6311,8 @@ in inherit (darwin.apple_sdk.frameworks) Security; }; + mathpix-snipping-tool = callPackage ../tools/misc/mathpix-snipping-tool { }; + /* Python 3.8 is currently broken with matrix-synapse since `python38Packages.bleach` fails (https://github.com/NixOS/nixpkgs/issues/76093) */ matrix-synapse = callPackage ../servers/matrix-synapse { /*python3 = python38;*/ };