aboutsummaryrefslogtreecommitdiff
path: root/srcds-pkgs/fetchdepotcache.nix
blob: 6546126c468795e3079cf3b6e16f02e2b1f42eb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
''