main
 1# Modify From https://github.com/powerofthe69/nix-gaming-edge
 2{
 3  lib,
 4  stdenv,
 5  fetchzip,
 6  renameInternalName ? true,
 7}:
 8stdenv.mkDerivation {
 9  pname = "dwproton";
10  version = "11.0-5";
11
12  src = fetchzip {
13    url = "https://dawn.wine/dawn-winery/dwproton/releases/download/dwproton-11.0-5/dwproton-11.0-5-x86_64.tar.xz";
14    hash = "sha256-2x4xotJ2aJYbg+G2TDPqyU7uuoc/hZQon9CA6SFGin0=";
15  };
16
17  outputs = [
18    "out"
19    "steamcompattool"
20  ];
21
22  installPhase = ''
23    runHook preInstall
24
25    # Create the steamcompat directory
26    mkdir -p $steamcompattool
27    cp -r ./* $steamcompattool/
28
29    # Remove broken symlinks from upstream tarball
30    find $steamcompattool -xtype l -delete
31
32    # Modify the display name
33    sed -i -r "s|\"display_name\".*|\"display_name\" \"dwproton\"|" \
34      $steamcompattool/compatibilitytool.vdf
35
36    ${lib.optionalString renameInternalName ''
37      sed -i -r 's|"dwproton-[^"]*"(\s*// Internal name)|"dwproton"\1|' $steamcompattool/compatibilitytool.vdf
38    ''}
39
40    # Create a real folder so that Steam doesn't require reselecting compatibility tool on update
41    mkdir -p $out/share/
42
43    # Create a real folder so that Steam doesn't require reselecting compatibility tool on update
44    mkdir -p $out/share/steam/compatibilitytools.d/dwproton
45
46    #Symlink the files INSIDE, not the folder itself. Oopsie
47    ln -s $steamcompattool/* $out/share/steam/compatibilitytools.d/dwproton/
48
49    runHook postInstall
50  '';
51
52  meta = {
53    description = "Dawn Winery's custom Proton fork with fixes for various games";
54    homepage = "https://dawn.wine/dawn-winery/dwproton";
55    license = lib.licenses.bsd3;
56    platforms = ["x86_64-linux"];
57  };
58}