Better graphical start

This commit is contained in:
2026-09-11 14:28:11 +02:00
parent b7cfc63310
commit 07b7e2bb05
13 changed files with 152 additions and 99 deletions
+1 -32
View File
@@ -1,7 +1,6 @@
{ lib, config, pkgs, ... }:
let
configuredMpv = config.programs.mpv.finalPackage;
shimWatchdog = pkgs.custom.jellyfin-mpv-shim-watchdog;
in{
config = lib.mkIf (config.syscfg.make.gui) {
@@ -83,36 +82,6 @@ in{
programs.yt-dlp.enable = true;
# The upstream jellyfin-mpv-shim service has no Restart and no network
# ordering: it happily starts while offline (silently dead) and never
# recovers a connection dropped by a network blip. Gate its start on the
# network being up, and let a watchdog notice the "up but not connected"
# state that systemd can't see. See pkgs.custom.jellyfin-mpv-shim-watchdog.
systemd.user.services.jellyfin-mpv-shim.Service = {
ExecStartPre = "${shimWatchdog}/bin/jellyfin-mpv-shim-watchdog wait-online";
TimeoutStartSec = "infinity"; # stay in start-pre until the network is back
Restart = "on-failure";
RestartSec = 5;
};
systemd.user.services.jellyfin-mpv-shim-watchdog = {
Unit = {
Description = "Restart jellyfin-mpv-shim when it is up but not connected";
After = [ "jellyfin-mpv-shim.service" ];
};
Service = {
Type = "oneshot";
ExecStart = "${shimWatchdog}/bin/jellyfin-mpv-shim-watchdog check";
};
};
systemd.user.timers.jellyfin-mpv-shim-watchdog = {
Unit.Description = "Periodic health check for jellyfin-mpv-shim";
Timer = {
OnActiveSec = "60s";
OnUnitActiveSec = "60s";
};
Install.WantedBy = [ "timers.target" ];
};
services.network-watchdog.units = [ "jellyfin-mpv-shim" ];
};
}