Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
		
			
				
	
	
		
			38 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ lib, stdenv, fetchurl
 | 
						|
 | 
						|
# for update script
 | 
						|
, writeShellScript, curl, nix-update
 | 
						|
}:
 | 
						|
 | 
						|
stdenv.mkDerivation rec {
 | 
						|
 | 
						|
  pname = "steam-runtime";
 | 
						|
  # from https://repo.steampowered.com/steamrt-images-scout/snapshots/
 | 
						|
  version = "0.20201203.1";
 | 
						|
 | 
						|
  src = fetchurl {
 | 
						|
    url = "https://repo.steampowered.com/steamrt-images-scout/snapshots/${version}/steam-runtime.tar.xz";
 | 
						|
    sha256 = "sha256-hOHfMi0x3K82XM3m/JmGYbVk5RvuHG+m275eAC0MoQc=";
 | 
						|
    name = "scout-runtime-${version}.tar.gz";
 | 
						|
  };
 | 
						|
 | 
						|
  buildCommand = ''
 | 
						|
    mkdir -p $out
 | 
						|
    tar -C $out --strip=1 -x -f $src
 | 
						|
  '';
 | 
						|
 | 
						|
  passthru = {
 | 
						|
    updateScript = writeShellScript "update.sh" ''
 | 
						|
      version=$(${curl}/bin/curl https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-steam-client-general-availability/VERSION.txt)
 | 
						|
      ${nix-update}/bin/nix-update --version "$version" steamPackages.steam-runtime
 | 
						|
    '';
 | 
						|
  };
 | 
						|
 | 
						|
  meta = with lib; {
 | 
						|
    description = "The official runtime used by Steam";
 | 
						|
    homepage = "https://github.com/ValveSoftware/steam-runtime";
 | 
						|
    license = licenses.unfreeRedistributable; # Includes NVIDIA CG toolkit
 | 
						|
    maintainers = with maintainers; [ hrdinka abbradar ];
 | 
						|
  };
 | 
						|
}
 |