make srcds derivation configurable

This commit is contained in:
Robin Appelman 2026-07-09 17:28:48 +02:00
commit b848ca3bc9
2 changed files with 17 additions and 4 deletions

View file

@ -12,9 +12,9 @@
system,
callPackage,
srcds-tf2,
sourcemod,
depots,
}: let
inherit (lib) importJSON map toString elem last replaceStrings naturalSort;
inherit (lib) importJSON map toString elem last replaceStrings naturalSort filter any;
depotInputs = importJSON ./depots.json;
fetchSupported = elem system depotdownloader.meta.platforms;
fetcher = input:
@ -47,7 +47,9 @@
exit 1
'';
};
allDepots = map fetcher depotInputs;
manifestUsed = manifest: any (depot: manifest.app_id == depot.app_id && manifest.depot_id == depot.depot_id) depots;
usedManifests = filter manifestUsed depotInputs;
allDepots = map fetcher usedManifests;
src = symlinkJoin {
name = "srcds-tf2-src";
paths = allDepots;

View file

@ -2,7 +2,18 @@ final: prev: let
inherit (prev.lib) toString importJSON listToAttrs map;
depotInputs = importJSON ./depots.json;
in {
srcds-tf2 = final.callPackage ./default.nix {};
srcds-tf2 = final.callPackage ./default.nix {
depots = [
{
app_id = 232250;
depot_id = 232256;
}
{
app_id = 232250;
depot_id = 232250;
}
];
};
steam-depots = listToAttrs (map (depot: {
name = "steam-depot-${toString depot.app_id}-${toString depot.depot_id}";
value = final.callPackage ./depot.nix {