btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / st / steam-unwrapped / package.nix
blobaff83ec2ef55611fbc1882e95665b907518de5b7
1 { lib, stdenv, fetchurl, bash }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "steam-unwrapped";
5   version = "1.0.0.81";
7   src = fetchurl {
8     # use archive url so the tarball doesn't 404 on a new release
9     url = "https://repo.steampowered.com/steam/archive/stable/steam_${finalAttrs.version}.tar.gz";
10     hash = "sha256-Gia5182s4J4E3Ia1EeC5kjJX9mSltsr+b+1eRtEXtPk=";
11   };
13   makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
15   postInstall = ''
16     rm $out/bin/steamdeps
18     # install udev rules
19     mkdir -p $out/etc/udev/rules.d/
20     cp ./subprojects/steam-devices/*.rules $out/etc/udev/rules.d/
21     substituteInPlace $out/etc/udev/rules.d/60-steam-input.rules \
22       --replace "/bin/sh" "${bash}/bin/bash"
24     # this just installs a link, "steam.desktop -> /lib/steam/steam.desktop"
25     rm $out/share/applications/steam.desktop
26     sed -e 's,/usr/bin/steam,steam,g' steam.desktop > $out/share/applications/steam.desktop
27   '';
29   passthru.updateScript = ./update.py;
31   meta = with lib; {
32     description = "Digital distribution platform";
33     longDescription = ''
34       Steam is a video game digital distribution service and storefront from Valve.
36       To install on NixOS, please use the option `programs.steam.enable = true`.
37     '';
38     homepage = "https://store.steampowered.com/";
39     license = licenses.unfreeRedistributable;
40     maintainers = lib.teams.steam.members ++ [ lib.maintainers.jagajaga ];
41     mainProgram = "steam";
42   };