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 90f3cb7384a9..16f7df766583 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6317,6 +6317,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;*/ };