diff options
Diffstat (limited to 'srcds-pkgs/fetchdepotcache.nix')
-rw-r--r-- | srcds-pkgs/fetchdepotcache.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/srcds-pkgs/fetchdepotcache.nix b/srcds-pkgs/fetchdepotcache.nix new file mode 100644 index 0000000..6546126 --- /dev/null +++ b/srcds-pkgs/fetchdepotcache.nix @@ -0,0 +1,27 @@ +{ lib, runCommand +, depotdownloader, cacert +}: +{ app, depot, manifest, hash }: +let + app' = builtins.toString app; + depot' = builtins.toString depot; +in +runCommand "depotcache-${manifest}" { + nativeBuildInputs = [ depotdownloader cacert ]; + outputHashMode = "recursive"; + outputHashAlgo = null; + outputHash = hash; + passthru = { inherit app depot manifest; }; +} '' + mkdir -p $out + export HOME=$out + cd $out + DepotDownloader \ + -app ${app'} \ + -depot ${depot'} \ + -manifest ${manifest} \ + -filelist /dev/null \ + -dir . + + rm -rf .local +'' |