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 ];