From 106c67963ea7fce5438d25b2b27e7fd102ce9585 Mon Sep 17 00:00:00 2001 From: Erik Simon Date: Fri, 24 Jul 2026 00:34:41 +0200 Subject: [PATCH] terra: package rishot, a quickshell screenshot/annotation overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not in nixpkgs — upstream ships a shell launcher + QML tree with no build step, driven entirely by `qs -p `. Packaged as a stdenvNoCC derivation that wraps the launcher with RISHOT_CONFIG_DIR (sidesteps its argv0-relative self-lookup, which wrapProgram breaks) and its runtime deps on PATH. Co-Authored-By: Claude Sonnet 5 --- pkgs/rishot.nix | 67 +++++++++++++++++++++++++++++++ services/desktop/desktop-apps.nix | 5 +++ 2 files changed, 72 insertions(+) create mode 100644 pkgs/rishot.nix diff --git a/pkgs/rishot.nix b/pkgs/rishot.nix new file mode 100644 index 0000000..c45c2ec --- /dev/null +++ b/pkgs/rishot.nix @@ -0,0 +1,67 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, makeWrapper +, quickshell +, wl-clipboard +, imagemagick +, cliphist +, curl +, kdePackages +, libnotify +}: + +# Wayland screenshot + annotation overlay, driven entirely by quickshell (qs -p +# ) rather than compiled — upstream ships bin/rishot (a shell launcher) +# plus src/*.qml, no nixpkgs package exists. bin/rishot resolves its QML dir at +# $self/../src by default, which breaks once wrapProgram rewrites argv0; setting +# RISHOT_CONFIG_DIR sidesteps that self-lookup entirely (see bin/rishot upstream). +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "rishot"; + version = "0-unstable-2026-07-10"; + + src = fetchFromGitHub { + owner = "Gakuseei"; + repo = "rishot"; + rev = "a87427a9083981315a080133636c38d8ca565d0e"; + hash = "sha256-FR7x4zAuCRKkPjU28r55JrlbbEd59S8wtIA+D/ooEeE="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + dontBuild = true; + dontConfigure = true; + + installPhase = '' + runHook preInstall + + install -Dm755 bin/rishot "$out/bin/rishot" + mkdir -p "$out/share/rishot" + cp -r src "$out/share/rishot/src" + + install -Dm644 rishot.desktop "$out/share/applications/rishot.desktop" + install -Dm644 packaging/rishot.svg "$out/share/icons/hicolor/scalable/apps/rishot.svg" + + wrapProgram "$out/bin/rishot" \ + --set RISHOT_CONFIG_DIR "$out/share/rishot/src" \ + --prefix PATH : ${lib.makeBinPath [ + quickshell + wl-clipboard + imagemagick + cliphist + curl + kdePackages.kdialog + libnotify + ]} + + runHook postInstall + ''; + + meta = { + description = "Wayland screenshot + annotation overlay built on quickshell"; + homepage = "https://github.com/Gakuseei/rishot"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + mainProgram = "rishot"; + }; +}) diff --git a/services/desktop/desktop-apps.nix b/services/desktop/desktop-apps.nix index b018b0a..2e589fa 100644 --- a/services/desktop/desktop-apps.nix +++ b/services/desktop/desktop-apps.nix @@ -1,5 +1,9 @@ { pkgs, lib, ... }: +let + rishot = pkgs.callPackage ../../pkgs/rishot.nix { }; +in + # Desktop applications for a workstation host (currently: terra). Split from # desktop-hyprland.nix, which owns the *session* (compositor, greeter, audio, # portals); this owns the things the user actually launches inside it. @@ -28,6 +32,7 @@ gitkraken jetbrains-toolbox kdePackages.dolphin + rishot ]; fonts.packages = [ pkgs.nerd-fonts.departure-mono ];