summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-02-19 14:07:27 +0300
committerNikolay Amiantov <ab@fmap.me>2016-02-19 14:10:13 +0300
commite41c80e7901702d7f24b0d880249056fc9ed730f (patch)
treee3724faf6c0dfe08c7e050804df416cb5f561e1e
parent9525abdeec4129de158369d323c673fa19c5fa64 (diff)
downloadnixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar.gz
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar.bz2
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar.lz
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar.xz
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.tar.zst
nixlib-e41c80e7901702d7f24b0d880249056fc9ed730f.zip
steamPackages: add runtime-mirror helper derivation
-rw-r--r--pkgs/games/steam/runtime-mirror.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/games/steam/runtime-mirror.nix b/pkgs/games/steam/runtime-mirror.nix
new file mode 100644
index 000000000000..49986a346e8e
--- /dev/null
+++ b/pkgs/games/steam/runtime-mirror.nix
@@ -0,0 +1,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;
+}