nexoniarz-config-nixos/modules/default-apps.nix
Nexoniarz 33bf94bd4c Add RTL-SDR support; switch to Limine + SDDM; drop Hyprland-era leftovers
RTL-SDR Blog V4. The V4 swapped the R820T2 tuner for an R828D behind a
built-in HF upconverter, so it needs the rtlsdrblog fork of librtlsdr --
the stock Osmocom one reports no supported devices. pkgs.rtl-sdr on this
channel already is that fork (rtl-sdr-blog 1.3.5), so hardware.rtl-sdr's
default package is correct as-is. That also blacklists the DVB-T drivers
that otherwise grab the dongle on plug-in, and ships udev rules handing it
to plugdev at 0660 -- hence plugdev in the user's groups, or every SDR app
needs root. Apps: SDR++ and rtl_433; the rtl_* CLI tools come with the
driver.

Both SDR apps are overridden to drop hardware we do not own. SDR++ and
rtl_433 default to supporting every radio ever made, which pulled in UHD
(1.4 GB of USRP firmware), BladeRF and LimeSuite. gqrx was the original
choice but reaches UHD through gr-osmosdr's gr-uhd feature; SDR++ uses no
GNU Radio at all. Per-package overrides rather than a global overlay, so
nothing else is affected.

Bootloader: systemd-boot -> Limine, themed to match the Gruvbox icon
theme. Limine installs to its own EFI directory and adds its own NVRAM
entry, so systemd-boot stays on the ESP as a firmware-menu fallback.

Display manager: lightdm -> SDDM with wayland.enable. Budgie in this
channel ships only a Wayland session (labwc) and was already running as
one; lightdm just handles that badly. SDDM's greeter runs on weston, not
kwin, so no KDE compositor comes along.

Qt defaults over Budgie's GTK/MATE apps. The Budgie module force-enables
gnome-terminal and installs nemo, eom, pluma, atril, engrampa, mate-calc
and mate-system-monitor; environment.budgie.excludePackages drops all of
them in favour of konsole, dolphin, gwenview, kate, okular, ark, kcalc and
plasma-systemmonitor. default-apps.nix rewritten to match: 113
associations, video to vlc, audio to elisa, text/code to kate, and
/etc/xdg/xdg-terminals.list pointing at konsole. Fixes a real bug there --
inode/directory was mapped to gwenview, so folders opened in the image
viewer.

Hyprland-era leftovers removed. system-telemetry and weather-fetch fed
Quickshell panels that no longer exist; brightness-ctl and hotspot-start
lost their keybinds. jq went with weather-fetch. Also dropped
gnome-screenshot, playerctl and imv. vault-toggle and strip-metadata stay
-- they never depended on Hyprland.

Comments trimmed throughout: deleted anything restating the code, kept the
ones recording a why you cannot recover by reading it (systemd.gpt_auto,
disable_ertm, ptrace_scope, the stable ethernet MAC, the mimeapps.list
parser gotcha). system.nix went 225 -> 166 lines.

README rewritten -- it still described Hyprland, Quickshell and Kitty.
Screenshot dropped.
2026-09-05 19:38:56 +02:00

80 lines
4 KiB
Nix

{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
libreoffice-qt6
];
# GIO picks the terminal from here for "Open Terminal" style actions.
environment.etc."xdg/xdg-terminals.list".text = ''
org.kde.konsole.desktop
'';
# System-level fallbacks. Per the XDG spec these are only consulted for a
# mimetype the user's own ~/.config/mimeapps.list doesn't already claim,
# so any "Open With" choice you make later still wins over this.
#
# One mimetype=desktopfile pair per line. The semicolon only separates
# multiple candidates for the SAME key — it does not chain separate pairs,
# and parsers match by scanning for a line starting with "mimetype=", so
# cramming several onto one line silently hides all but the first.
environment.etc."xdg/mimeapps.list".text =
let
gwenviewMimes = [
"image/avif" "image/gif" "image/heif" "image/jpeg"
"image/jxl" "image/png" "image/bmp" "image/x-eps" "image/x-icns"
"image/x-ico" "image/x-portable-bitmap" "image/x-portable-graymap"
"image/x-portable-pixmap" "image/x-xbitmap" "image/x-xpixmap"
"image/tiff" "image/x-psd" "image/x-webp" "image/webp" "image/x-tga"
"image/x-xcf" "image/openraster" "image/svg+xml" "image/svg+xml-compressed"
];
arkMimes = [
"application/x-cd-image" "application/x-bcpio" "application/x-cpio"
"application/x-cpio-compressed" "application/x-rpm" "application/x-compress"
"application/gzip" "application/x-bzip" "application/x-bzip2"
"application/x-lzma" "application/x-xz" "application/zstd" "application/x-lz4"
"application/x-source-rpm" "application/vnd.debian.binary-package"
"application/vnd.ms-cab-compressed" "application/x-archive" "application/x-tar"
"application/x-compressed-tar" "application/x-bzip-compressed-tar"
"application/x-bzip2-compressed-tar" "application/x-tarz"
"application/x-xz-compressed-tar" "application/x-lzma-compressed-tar"
"application/x-7z-compressed" "application/vnd.rar" "application/zip"
"application/x-java-archive" "application/x-arj"
];
okularMimes = [
"application/pdf" "application/x-pdf" "image/vnd.djvu" "application/epub+zip"
"application/x-fictionbook+xml" "application/x-mobipocket-ebook"
"image/x-portable-document" "application/x-cbr" "application/x-cbz"
"application/x-cbt" "application/x-cb7" "application/postscript"
];
vlcMimes = [
"video/mp4" "video/x-matroska" "video/webm" "video/x-msvideo"
"video/quicktime" "video/mpeg" "video/x-ms-wmv" "video/x-flv"
"video/3gpp" "video/ogg" "video/x-theora+ogg" "video/x-ogm+ogg"
"application/x-matroska" "application/vnd.rn-realmedia"
];
elisaMimes = [
"audio/mpeg" "audio/flac" "audio/x-flac" "audio/ogg" "audio/x-vorbis+ogg"
"audio/opus" "audio/x-opus+ogg" "audio/mp4" "audio/aac" "audio/x-wav"
"audio/wav" "audio/x-ms-wma" "audio/x-aiff" "audio/x-musepack"
];
kateMimes = [
"text/plain" "text/markdown" "text/x-csrc" "text/x-c++src" "text/x-chdr"
"text/x-c++hdr" "text/x-python" "text/x-java" "text/x-shellscript"
"text/x-nix" "text/css" "text/html" "text/xml" "application/json"
"application/x-yaml" "application/toml" "application/javascript"
"application/x-shellscript" "text/x-log"
];
line = desktop: mime: "${mime}=${desktop}";
in
''
[Default Applications]
inode/directory=org.kde.dolphin.desktop
${lib.concatMapStringsSep "\n" (line "org.kde.gwenview.desktop") gwenviewMimes}
${lib.concatMapStringsSep "\n" (line "org.kde.ark.desktop") arkMimes}
${lib.concatMapStringsSep "\n" (line "org.kde.okular.desktop") okularMimes}
${lib.concatMapStringsSep "\n" (line "vlc.desktop") vlcMimes}
${lib.concatMapStringsSep "\n" (line "org.kde.elisa.desktop") elisaMimes}
${lib.concatMapStringsSep "\n" (line "org.kde.kate.desktop") kateMimes}
'';
}