Skip to content

Commit

Permalink
Merge pull request #2 from icewind1991/filelist
Browse files Browse the repository at this point in the history
allow specifying filelist to download
  • Loading branch information
aidalgol authored Dec 27, 2023
2 parents 2033f99 + f0c1e9e commit aa223d3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
# branch = "beta_name";
# Enable debug logging from DepotDownloader.
# debug = true;
# Only download specific files
# fileList = ["filename" "regex:(or|a|regex)"];
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
Expand Down
4 changes: 4 additions & 0 deletions fetch-steam/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if [ -n "$debug" ]; then
args+=(-debug)
fi

if [ -n "$filelist" ]; then
args+=(-filelist "$filelist")
fi

DepotDownloader \
"${args[@]}" \
-dir "${out:?}"
37 changes: 24 additions & 13 deletions fetch-steam/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,36 @@
stdenvNoCC,
depotdownloader,
cacert,
writeText,
}: {
name,
debug ? false,
appId,
depotId,
manifestId,
branch ? null,
fileList ? [],
hash,
}:
stdenvNoCC.mkDerivation {
name = "${name}-depot";
inherit debug appId depotId manifestId branch;
builder = ./builder.sh;
buildInputs = [
depotdownloader
];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
}: let
fileListFile = let
content = lib.concatStringsSep "\n" fileList;
in
writeText "steam-file-list-${name}.txt" content;
in
stdenvNoCC.mkDerivation {
name = "${name}-depot";
inherit debug appId depotId manifestId branch;
filelist =
if fileList != []
then fileListFile
else null;
builder = ./builder.sh;
buildInputs = [
depotdownloader
];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

outputHash = hash;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
}
outputHash = hash;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
}

0 comments on commit aa223d3

Please sign in to comment.