From 7e7c7a550fdff5fe2a987acc0ba060dfd9ab0a8e Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Thu, 8 Oct 2026 10:49:49 +0100 Subject: [PATCH] fix(flatpak): install GL runtime matching nvidia driver Co-Authored-By: Claude Sonnet 5.5 --- hosts/common/features/flatpak.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hosts/common/features/flatpak.nix b/hosts/common/features/flatpak.nix index 0a2e3a5..7366901 100644 --- a/hosts/common/features/flatpak.nix +++ b/hosts/common/features/flatpak.nix @@ -1,4 +1,10 @@ -{ inputs, lib, ... }: +{ config, inputs, lib, ... }: +let + # The Flatpak GL runtime must match the host NVIDIA driver exactly, or apps + # fail with "Unable to create a valid OpenGL context". + nvidiaGl = "org.freedesktop.Platform.GL.nvidia-" + builtins.replaceStrings [ "." ] [ "-" ] config.hardware.nvidia.package.version; +in + { imports = [ inputs.nix-flatpak.nixosModules.nix-flatpak ]; @@ -15,6 +21,9 @@ ]; packages = [ + # Tracks the driver version, so it follows nvidia bumps automatically. + { appId = nvidiaGl; origin = "flathub"; } + # PrusaSlicer 3.x. As of 3.0 Prusa ships no Linux binary at all — Flathub # is the only channel, and the alphas live in flathub-beta. Runs alongside # pkgs.prusa-slicer (2.9.x, in home/common/programs/3d.nix): 3.x keeps its