summary refs log tree commit diff
path: root/pkgs/games/steam/runtime-mirror.nix
blob: 49986a346e8e173fa1d57ee78f1f1a1e817660b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ pkgs ? import <nixpkgs> {} }:

let
  inherit (pkgs) lib;
  rt = import ./runtime-generated.nix { inherit (pkgs) fetchurl; };
  convRt = x: {
    path = lib.removePrefix "mirror://steamrt/" x.url;
    file = x.source;
  };
  files = builtins.map convRt (lib.concatLists (lib.attrValues rt));
  
in pkgs.stdenv.mkDerivation {
  name = "steam-runtime-mirror";
  buildCommand = ''
    mkdir $out
  '' + lib.concatMapStringsSep "\n" (x: ''
    mkdir -p $(dirname $out/${x.path})
    ln -sf ${x.file} $out/${x.path}
  '') files;
}