Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow specifying filelist to download #2

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
}