From e41c80e7901702d7f24b0d880249056fc9ed730f Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Fri, 19 Feb 2016 14:07:27 +0300 Subject: [PATCH] steamPackages: add runtime-mirror helper derivation --- pkgs/games/steam/runtime-mirror.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pkgs/games/steam/runtime-mirror.nix diff --git a/pkgs/games/steam/runtime-mirror.nix b/pkgs/games/steam/runtime-mirror.nix new file mode 100644 index 00000000000..49986a346e8 --- /dev/null +++ b/pkgs/games/steam/runtime-mirror.nix @@ -0,0 +1,20 @@ +{ pkgs ? import {} }: + +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; +}