depot/third_party/nixpkgs/pkgs/games/steam/runtime-mirror.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

20 lines
527 B
Nix

{ 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;
}