Something went wrong. Try again.
Nix configuration
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657{ stdenv, lib, fetchFromGitHub, glib, gettext, jq }:
stdenv.mkDerivation rec { pname = "gnome-shell-extension-snaptext"; version = "unstable-2026-06-20"; uuid = "snaptext@cwittenberg";
src = fetchFromGitHub { owner = "cwittenberg"; repo = "snaptext"; rev = "92bdb5c69790"; hash = "sha256-L1nW3Jzck7yRnIjI0YLV1Z3YFUBVNuo5Sgd/ZoWEUlY="; };
nativeBuildInputs = [ glib gettext jq ];
dontConfigure = true;
buildPhase = '' runHook preBuild # GNOME 45+ requires an integer "version" field in metadata.json jq '. + {"version": 1}' metadata.json > metadata.json.tmp && mv metadata.json.tmp metadata.json glib-compile-schemas --strict schemas/ if [ -d po ]; then for po_file in po/*.po; do [ -f "$po_file" ] || continue lang=$(basename "$po_file" .po) mkdir -p locale/$lang/LC_MESSAGES msgfmt "$po_file" -o locale/$lang/LC_MESSAGES/snaptext.mo done fi runHook postBuild '';
installPhase = '' runHook preInstall dest=$out/share/gnome-shell/extensions/${uuid} mkdir -p $dest cp metadata.json extension.js selection.js prefs.js ocr.js \ dependencies.js smartextractor.js smartmenu.js smartpatterns.js $dest/ cp -r schemas $dest/ [ -d locale ] && cp -r locale $dest/ || true [ -f stylesheet.css ] && cp stylesheet.css $dest/ || true [ -f trayicon.svg ] && cp trayicon.svg $dest/ || true runHook postInstall '';
passthru.extensionUuid = uuid;
meta = with lib; { description = "Grab text from anywhere on your screen with OCR (macOS-like)"; homepage = "https://github.com/cwittenberg/snaptext"; license = licenses.gpl3Plus; platforms = platforms.linux; };}