Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / steam / runtime.nix
blob593d78afe0ccdec13d4cf33ee1a485198ada4f03
1 { lib, stdenv, fetchurl
3 # for update script
4 , writeShellScript, curl, nix-update
5 }:
7 stdenv.mkDerivation rec {
9   pname = "steam-runtime";
10   # from https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-steam-client-general-availability/VERSION.txt
11   version = "0.20220601.1";
13   src = fetchurl {
14     url = "https://repo.steampowered.com/steamrt-images-scout/snapshots/${version}/steam-runtime.tar.xz";
15     sha256 = "sha256-uYauNtbUlvrnATGks7hWy1zt4Y7AEeADrCr1eVylPbY=";
16     name = "scout-runtime-${version}.tar.gz";
17   };
19   buildCommand = ''
20     mkdir -p $out
21     tar -C $out --strip=1 -x -f $src
22   '';
24   passthru = {
25     updateScript = writeShellScript "update.sh" ''
26       version=$(${curl}/bin/curl https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-steam-client-general-availability/VERSION.txt)
27       ${lib.getExe nix-update} --version "$version" steamPackages.steam-runtime
28     '';
29   };
31   meta = with lib; {
32     description = "The official runtime used by Steam";
33     homepage = "https://github.com/ValveSoftware/steam-runtime";
34     license = licenses.unfreeRedistributable; # Includes NVIDIA CG toolkit
35     maintainers = with maintainers; [ hrdinka abbradar ];
36   };