Repository navigation
Expand file tree
/
Copy pathpackage.nix
More file actions
61 lines (53 loc) · 2.31 KB
/
Copy pathpackage.nix
File metadata and controls
61 lines (53 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
lib,
appimageTools,
fetchurl,
}:
let
pname = "openwhispr";
version = "1.7.4";
src = fetchurl {
url = "https://github.com/OpenWhispr/openwhispr/releases/download/v${version}/OpenWhispr-${version}-linux-x86_64.AppImage";
hash = "sha256-hp7FVUi5/K+QiQam8YAOrRsemFkC8MnupT+hhroP+6Y=";
};
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
# Runtime tools and libraries the AppImage needs but does not bundle.
# The wrapType2 FHS env already provides the base Chromium/GTK/X11/nss stack;
# host PATH still resolves compositor tools (hyprctl, qdbus, gsettings, systemctl).
extraPkgs = pkgs: with pkgs; [
# Clipboard + keystroke injection backends the app shells out to. See #728.
xdotool # X11/XWayland keystroke + active-window detection
wtype # wlroots (Sway/Hyprland) keystroke injection
ydotool # uinput-based keystroke injection (GNOME/KDE Wayland)
wl-clipboard # wl-copy / wl-paste
xclip # X11 clipboard + primary selection
xsel # X11 clipboard/primary fallback
kdotool # KDE Wayland active-window class detection for terminal-aware paste
playerctl # MPRIS media auto-pause fallback
# Libraries beyond the FHS defaults.
libsecret # Electron safeStorage keyring (API keys at rest)
libnotify # Electron desktop notifications
libpulseaudio # Chromium mic capture via PulseAudio/PipeWire
pipewire # Native Linux system audio helper links libpipewire-0.3
stdenv.cc.cc.lib # libstdc++/libgomp for bundled whisper/llama/sherpa/qdrant
];
extraInstallCommands = ''
install -Dm444 ${appimageContents}/open-whispr.desktop \
$out/share/applications/${pname}.desktop
substituteInPlace $out/share/applications/${pname}.desktop \
--replace-fail 'Exec=AppRun --no-sandbox' 'Exec=${pname} --no-sandbox'
cp -r ${appimageContents}/usr/share/icons $out/share/icons
'';
meta = {
description = "Privacy-first desktop voice dictation, meeting transcription & notes";
homepage = "https://openwhispr.com/";
changelog = "https://github.com/OpenWhispr/openwhispr/releases/tag/v${version}";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
mainProgram = pname;
};
}