From 1b42f2ffbf5c12044b9792a77f5828f6877ccae1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 14 Mar 2024 05:40:09 +0300 Subject: proton-ge-bin: init at init at 9-1 Co-authored-by: Shawn8901 --- pkgs/by-name/pr/proton-ge-bin/package.nix | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkgs/by-name/pr/proton-ge-bin/package.nix (limited to 'pkgs/by-name/pr') diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix new file mode 100644 index 000000000000..1002a549cbcd --- /dev/null +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -0,0 +1,50 @@ +{ lib +, stdenvNoCC +, fetchurl +, writeScript +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "proton-ge-bin"; + version = "GE-Proton9-1"; + + src = fetchurl { + url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${finalAttrs.version}/${finalAttrs.version}.tar.gz"; + hash = "sha256-wCIffeayOy3kEwmIKB7e+NrliuSpKXoVYC334fxVB3U="; + }; + + buildCommand = '' + runHook preBuild + mkdir -p $out/{bin,opt} + tar -C $out/opt --strip=1 -x -f $src + ln -s $out/opt/toolmanifest.vdf $out/bin/toolmanifest.vdf + install -Dm644 $out/opt/compatibilitytool.vdf $out/bin/compatibilitytool.vdf + substituteInPlace $out/bin/compatibilitytool.vdf \ + --replace-fail '"install_path" "."' '"install_path" "${placeholder "out"}/opt"' + runHook postBuild + ''; + + /* + We use the created releases, and not the tags, for the update script as nix-update loads releases.atom + that contains both. Sometimes upstream pushes the tags but the Github releases don't get created due to + CI errors. Last time this happened was on 8-33, where a tag was created but no releases were created. + As of 2024-03-13, there have been no announcements indicating that the CI has been fixed, and thus + we avoid nix-update-script and use our own update script instead. + See: + */ + passthru.updateScript = writeScript "update-proton-ge" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl jq common-updater-scripts + repo="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases" + version="$(curl -sL "$repo" | jq 'map(select(.prerelease == false)) | .[0].tag_name' --raw-output)" + update-source-version proton-ge-bin "$version" + ''; + + meta = { + description = "Compatibility tool for Steam Play based on Wine and additional components"; + homepage = "https://github.com/GloriousEggroll/proton-ge-custom"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ NotAShelf shawn8901 ]; + platforms = [ "x86_64-linux" ]; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + }; +}) -- cgit 1.4.1 From 2b619c23146b7b791ed25a174add5cc8d99c8654 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 14 Mar 2024 23:54:02 +0100 Subject: nixos/steam: use steamcompattool output for extraCompatPackages This sets a standard for Steam compat tools in NixOS where they must have the compat tool in a special steamcompattool output. proton-ge-bin was adjusted to conform with it. --- nixos/modules/programs/steam.nix | 8 +++++--- pkgs/by-name/pr/proton-ge-bin/package.nix | 12 ++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'pkgs/by-name/pr') diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index 31803f061dce..8fc0f35c0dce 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -44,8 +44,8 @@ in { ''; apply = steam: steam.override (prev: { extraEnv = (lib.optionalAttrs (cfg.extraCompatPackages != [ ]) { - STEAM_EXTRA_COMPAT_TOOLS_PATHS = makeBinPath cfg.extraCompatPackages; - }) // (prev.extraEnv or {}); + STEAM_EXTRA_COMPAT_TOOLS_PATHS = makeSearchPathOutput "steamcompattool" "" cfg.extraCompatPackages; + }) // (prev.extraEnv or {}); extraLibraries = pkgs: let prevLibs = if prev ? extraLibraries then prev.extraLibraries pkgs else [ ]; additionalLibs = with config.hardware.opengl; @@ -77,7 +77,9 @@ in { description = lib.mdDoc '' Extra packages to be used as compatibility tools for Steam on Linux. Packages will be included in the `STEAM_EXTRA_COMPAT_TOOLS_PATHS` environmental variable. For more information see - . + https://github.com/ValveSoftware/steam-for-linux/issues/6310. + + These packages must be Steam compatibility tools that have a `steamcompattool` output. ''; }; diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix index 1002a549cbcd..c64723a6b5a4 100644 --- a/pkgs/by-name/pr/proton-ge-bin/package.nix +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -12,14 +12,14 @@ stdenvNoCC.mkDerivation (finalAttrs: { hash = "sha256-wCIffeayOy3kEwmIKB7e+NrliuSpKXoVYC334fxVB3U="; }; + outputs = [ "out" "steamcompattool" ]; + buildCommand = '' runHook preBuild - mkdir -p $out/{bin,opt} - tar -C $out/opt --strip=1 -x -f $src - ln -s $out/opt/toolmanifest.vdf $out/bin/toolmanifest.vdf - install -Dm644 $out/opt/compatibilitytool.vdf $out/bin/compatibilitytool.vdf - substituteInPlace $out/bin/compatibilitytool.vdf \ - --replace-fail '"install_path" "."' '"install_path" "${placeholder "out"}/opt"' + mkdir -p $out $steamcompattool + + tar -C $steamcompattool --strip=1 -x -f $src + runHook postBuild ''; -- cgit 1.4.1 From ac37f3f75475afe6641aa35ce50e7fca9ece0134 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 15 Mar 2024 00:05:55 +0100 Subject: proton-ge-bin: simplify Simply use fetchzip and create a symlink to the src rather than unpacking manually. --- pkgs/by-name/pr/proton-ge-bin/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pkgs/by-name/pr') diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix index c64723a6b5a4..92c841349a4a 100644 --- a/pkgs/by-name/pr/proton-ge-bin/package.nix +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -1,24 +1,26 @@ { lib , stdenvNoCC -, fetchurl +, fetchzip , writeScript }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "proton-ge-bin"; version = "GE-Proton9-1"; - src = fetchurl { + src = fetchzip { url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${finalAttrs.version}/${finalAttrs.version}.tar.gz"; - hash = "sha256-wCIffeayOy3kEwmIKB7e+NrliuSpKXoVYC334fxVB3U="; + hash = "sha256-odpzRlzW7MJGRcorRNo784Rh97ssViO70/1azHRggf0="; }; outputs = [ "out" "steamcompattool" ]; buildCommand = '' runHook preBuild - mkdir -p $out $steamcompattool - tar -C $steamcompattool --strip=1 -x -f $src + # Intentionally empty + mkdir -p $out + + ln -s $src $steamcompattool runHook postBuild ''; -- cgit 1.4.1 From 74c55dbb254680170610c931fb839966d7c0bad2 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 15 Mar 2024 00:22:28 +0100 Subject: proton-ge-bin: make $out provide an error when added to an env This package should never be added to systemPackages or other global environments as it will not provide any function there. Making its $out a file will prevent buildEnv from including it; providing an error like this: error: The store path /nix/store/wxl3m27dmjjsfqvzzxw7ibr0gr54wwkp-proton-ge-bin-GE-Proton9-1 is a file and can't be merged into an environment using pkgs.buildEnv! at /nix/store/ndhb3bsaf3zc6gx22vjl0w11sxvapf7b-builder.pl line 122. Some breadcrumbs are left inside the file. --- pkgs/by-name/pr/proton-ge-bin/package.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pkgs/by-name/pr') diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix index 92c841349a4a..68e147ca4f9c 100644 --- a/pkgs/by-name/pr/proton-ge-bin/package.nix +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -17,8 +17,9 @@ stdenvNoCC.mkDerivation (finalAttrs: { buildCommand = '' runHook preBuild - # Intentionally empty - mkdir -p $out + # Make it impossible to add to an environment. You should use the appropriate NixOS option. + # Also leave some breadcrumbs in the file. + echo "${finalAttrs.pname} should not be installed into environments. Please use programs.steam.extraCompatPackages instead." > $out ln -s $src $steamcompattool @@ -42,7 +43,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; meta = { - description = "Compatibility tool for Steam Play based on Wine and additional components"; + description = '' + Compatibility tool for Steam Play based on Wine and additional components. + + (This is intended for use in the `programs.steam.extraCompatPackages` option only.) + ''; homepage = "https://github.com/GloriousEggroll/proton-ge-custom"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ NotAShelf shawn8901 ]; -- cgit 1.4.1