Launchers: apps' own desktop entries, rewritten; keyring moves into them

steamFrame.launchers.<desktop ID> takes the app's own entry (a Flatpak's
export, a Nix package's or a host file) and rewrites only its command lines
(hostEnv, env, flatpakArgs, args, wrappers) and the keys asked for
(mimeTypes, defaultFor, settings), so name, icon, translations and actions
stay the app's and follow its updates.

- Package entries are rewritten at build time; Flatpak/host file entries at
  runtime by steam-frame-nix-launchers into
  <session.runtimeDir>/steam-frame-nix/applications (tmpfs), on switch, at
  login and when Flatpak installs/updates apps (path unit); the Home Manager
  links point there.
- keyring.{enable,electron} replaces steamFrame.keyring.{flatpaks,programs}
  (clean break: the old options fail with the new form).
- Firefox's launcher is the Flatpak's entry with the profile wrapper in
  front (no --profile for the profile manager); Jellyfin's hardware
  decoding sets flatpakArgs and env.
- cleanup --all removes the tmpfs entries.
- Check on copies of the real Element, KRDC, Firefox, gedit, Jellyfin and
  Claude entries, quoting and generator behaviour.
This commit is contained in:
Pierre Kisters committed 2026-09-29 02:05:06 +02:00
1 parent 5d15902ba1
commit 0d9a238e5a
37 files changed
+4140 -577

No files matched your search

+14 -6
View File
@@ -1,8 +1,9 @@
# Checks of the Firefox launcher's desktop profile user.js (launcher.nix)
# Checks of the Firefox wrapper's desktop profile user.js (wrapper.nix)
# against a fake flatpak: the link exists only while Firefox runs, a second
# launch that hands over to the running Firefox doesn't remove it, the value
# Firefox stored from it leaves prefs.js once the profile is unlocked, and a
# user.js of the user's own is never touched.
# Firefox stored from it leaves prefs.js once the profile is unlocked, a
# user.js of the user's own is never touched, the profile manager action and
# the Steam session get no --profile.
{ pkgs }:
let
# Fake `flatpak run … org.mozilla.firefox --profile DIR …`: with the
@@ -22,11 +23,12 @@ let
while [ ! -e $FAKE/release ]; do sleep 0.1; done
exit 3
'';
launcher = pkgs.callPackage ./launcher.nix {
flatpakBin = fakeFlatpak;
wrapper = pkgs.callPackage ./wrapper.nix {
profileDir = "$HOME/ff/desktop";
desktopFix = true;
};
# What the launcher's Exec= runs: the wrapper, then the Flatpak's command.
launcher = "${wrapper} ${fakeFlatpak} run --branch=stable --arch=aarch64 --command=firefox --file-forwarding org.mozilla.firefox";
in
pkgs.runCommand "firefox-check" { nativeBuildInputs = [ pkgs.findutils pkgs.gnugrep ]; } ''
set -euo pipefail
@@ -36,7 +38,7 @@ pkgs.runCommand "firefox-check" { nativeBuildInputs = [ pkgs.findutils pkgs.gnug
p=$HOME/ff/desktop
# first launch: link made, Firefox runs
${launcher} https://example.org & first=$!
${launcher} @@u https://example.org @@ & first=$!
for i in $(seq 100); do grep -q started $FAKE/log && break; sleep 0.1; done
grep -qx 'started /app/etc/firefox/steam-frame-nix-desktop-user.js' $FAKE/log || fail "not linked at start"
echo 'user_pref("other", 1);' >> $p/prefs.js
@@ -59,6 +61,12 @@ pkgs.runCommand "firefox-check" { nativeBuildInputs = [ pkgs.findutils pkgs.gnug
grep -q ignore-widgets $p/prefs.js || fail "prefs.js changed with an own user.js"
rm $p/user.js
# profile manager action: no --profile, no link
: > $FAKE/log
${launcher} --ProfileManager || true
grep -qx 'default profile' $FAKE/log || fail "--profile with --ProfileManager"
[ ! -e $p/user.js ] || fail "linked for the profile manager"
# Steam session: default profile, no link
: > $FAKE/log
XDG_CURRENT_DESKTOP=gamescope ${launcher} || true