terra: package rishot, a quickshell screenshot/annotation overlay
Not in nixpkgs — upstream ships a shell launcher + QML tree with no build step, driven entirely by `qs -p <dir>`. 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
# <dir>) 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";
|
||||
};
|
||||
})
|
||||
@@ -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 ];
|
||||
|
||||
Reference in New Issue
Block a user