mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
steamPackages: add runtime-mirror helper derivation
This commit is contained in:
parent
9525abdeec
commit
e41c80e790
20
pkgs/games/steam/runtime-mirror.nix
Normal file
20
pkgs/games/steam/runtime-mirror.nix
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user