From fc33393951c25f1dd1e9edbf4acd0a2e90bc0168 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 11 Feb 2025 03:06:14 +0000 Subject: [PATCH] umu-launcher: use steam's FHS profile Some games require additional profile/environment, according to: https://github.com/NixOS/nixpkgs/issues/297662#issuecomment-2647656699 To keep things simple and maintainable, use Steam's `profile` FHS arg. --- pkgs/by-name/um/umu-launcher/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/by-name/um/umu-launcher/package.nix b/pkgs/by-name/um/umu-launcher/package.nix index aa9bf806b89d..a282d7d3e2ab 100644 --- a/pkgs/by-name/um/umu-launcher/package.nix +++ b/pkgs/by-name/um/umu-launcher/package.nix @@ -1,11 +1,20 @@ { buildFHSEnv, lib, + steam, umu-launcher-unwrapped, extraPkgs ? pkgs: [ ], extraLibraries ? pkgs: [ ], + extraProfile ? "", # string to append to shell profile + extraEnv ? { }, # Environment variables to include in shell profile withMultiArch ? true, # Many Wine games need 32-bit libraries. }: +let + # Steam is not a dependency, but we re-use some of its implementation + steam' = steam.override { + inherit extraEnv extraProfile; + }; +in buildFHSEnv { pname = "umu-launcher"; inherit (umu-launcher-unwrapped) version meta; @@ -27,4 +36,10 @@ buildFHSEnv { ln -s ${umu-launcher-unwrapped}/lib $out/lib ln -s ${umu-launcher-unwrapped}/share $out/share ''; + + # For umu & proton, we need roughly the same environment as Steam. + # For simplicity, we use Steam's `profile` implementation. + # See https://github.com/NixOS/nixpkgs/pull/381047 + # And https://github.com/NixOS/nixpkgs/issues/297662#issuecomment-2647656699 + inherit (steam'.args) profile; }