From 0e3a277c0f333192528cdb66f3823ed54f3d4404 Mon Sep 17 00:00:00 2001
From: Lillian-Violet <git@lillianviolet.dev>
Date: Thu, 27 Mar 2025 15:29:45 +0100
Subject: [PATCH] try some mpv tweaks I guess

---
 nixos/hosts/wheatley/configuration.nix | 55 +++++++++++++++-----------
 1 file changed, 33 insertions(+), 22 deletions(-)

diff --git a/nixos/hosts/wheatley/configuration.nix b/nixos/hosts/wheatley/configuration.nix
index 2310c0c..e06b7b7 100644
--- a/nixos/hosts/wheatley/configuration.nix
+++ b/nixos/hosts/wheatley/configuration.nix
@@ -150,6 +150,15 @@
 
     initrd.kernelModules = ["vc4" "bcm2835_dma" "i2c_bcm2835" "cma=256M" "console=tty0" "reset-raspberrypi"];
     kernelParams = ["video=HDMI-A-1:1920x1080@60D"];
+    kernelPatches = [
+      {
+        name = "performance-upgrade";
+        patch = "null";
+        extraConfig = ''
+          CMA_SIZE_MBYTES = 256
+        '';
+      }
+    ];
     kernel.sysctl = {
       "net.ipv4.ip_forward" = 1;
       "net.ipv6.conf.all.forwarding" = 1;
@@ -319,28 +328,29 @@
   ];
 
   environment.systemPackages = [
-    (pkgs.kodi.withPackages (kodiPkgs:
-      with kodiPkgs; [
-        steam-controller
-        invidious
-        youtube
-        netflix
-        upnext
-        sponsorblock
-        sendtokodi
-        jellyfin
-        inputstream-adaptive
-        inputstreamhelper
-        inputstream-ffmpegdirect
-        upnext
-        sponsorblock
-        sendtokodi
-        routing
-        requests-cache
-        requests
-        plugin-cache
-        a4ksubtitles
-      ]))
+    pkgs.mpv
+    # (pkgs.kodi.withPackages (kodiPkgs:
+    #   with kodiPkgs; [
+    #     steam-controller
+    #     invidious
+    #     youtube
+    #     netflix
+    #     upnext
+    #     sponsorblock
+    #     sendtokodi
+    #     jellyfin
+    #     inputstream-adaptive
+    #     inputstreamhelper
+    #     inputstream-ffmpegdirect
+    #     upnext
+    #     sponsorblock
+    #     sendtokodi
+    #     routing
+    #     requests-cache
+    #     requests
+    #     plugin-cache
+    #     a4ksubtitles
+    #   ]))
     pkgs.iptables
   ];
 
@@ -348,6 +358,7 @@
   services.cage.user = "kodi";
   services.cage.program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
   services.cage.enable = true;
+  nixpkgs.config.kodi.enableAdvancedLauncher = true;
 
   system.stateVersion = "25.05";
   nixpkgs.hostPlatform = lib.mkForce "aarch64-linux";