improve srcds time/versioning

This commit is contained in:
Robin Appelman 2026-07-09 15:07:52 +02:00
commit 3c3bf63ddf
2 changed files with 19 additions and 19 deletions

View file

@ -11,8 +11,8 @@
steamworks-sdk-redist, steamworks-sdk-redist,
system, system,
}: let }: let
inherit (builtins) fromJSON readFile map toString elem head replaceStrings; inherit (lib) importJSON map toString elem last replaceStrings naturalSort;
depotInputs = fromJSON (readFile ./depots.json); depotInputs = importJSON ./depots.json;
fetchSupported = elem system depotdownloader.meta.platforms; fetchSupported = elem system depotdownloader.meta.platforms;
fetcher = input: fetcher = input:
if fetchSupported if fetchSupported
@ -49,8 +49,9 @@
name = "srcds-tf2-src"; name = "srcds-tf2-src";
paths = allDepots; paths = allDepots;
}; };
timeToVersion = replaceStrings ["T" ":" "Z"] ["-" "-" ""]; timeToVersion = replaceStrings ["T" ":"] ["-" "-"];
time = (head depotInputs).date; times = map (depot: depot.date) depotInputs;
time = last (naturalSort times);
curlCompat = curlWithGnuTls.overrideAttrs ( curlCompat = curlWithGnuTls.overrideAttrs (
final: prev: { final: prev: {
@ -82,8 +83,7 @@ in
chmod -R +w $out chmod -R +w $out
# the steamclient.so included in the depot is 32bit so it wont work # the steamclient.so included in the depot is 32bit so it wont work
cp ${steamworks-sdk-redist}/lib/steamclient.so $out/bin/steamclient.so cp ${steamworks-sdk-redist}/lib/steamclient.so $out/bin/linux64/steamclient.so
chmod -R +w $out/bin/steamclient.so
echo 440 > $out/steam_appid.txt echo 440 > $out/steam_appid.txt

View file

@ -3,22 +3,22 @@
def main [] { def main [] {
update_all_depots update_all_depots
nix-update --flake --use-update-script ambuild # nix-update --flake --use-update-script ambuild
nix build .#ambuild # nix build .#ambuild
nix-update --flake --version=$"(get_metamod_version)" metamod-source # nix-update --flake --version=$"(get_metamod_version)" metamod-source
nix build .#metamods.x86_64-linux.tf2 # nix build .#metamods.x86_64-linux.tf2
nix-update --flake --use-update-script sourcemod # nix-update --flake --use-update-script sourcemod
nix build .#sourcemods.x86_64-linux.tf2 # nix build .#sourcemods.x86_64-linux.tf2
let sdks = open nix/sourcemod/hl2sdks.json | columns # let sdks = open nix/sourcemod/hl2sdks.json | columns
$sdks | each {|sdk| update_sdk $sdk} # $sdks | each {|sdk| update_sdk $sdk}
nix-update --flake --use-update-script sourcemod-include-curl # nix-update --flake --use-update-script sourcemod-include-curl
nix-update --flake --use-update-script sourcemod-include-library # nix-update --flake --use-update-script sourcemod-include-library
nix-update --flake --use-update-script sourcemod-include-steamworks # nix-update --flake --use-update-script sourcemod-include-steamworks
nix-update --flake --use-update-script sourcemod-includes # nix-update --flake --use-update-script sourcemod-includes
nix fmt nix fmt
} }
@ -46,7 +46,7 @@ def get_manifest [app: int, depot: int] {
# builting rm doesn't work for some reason? # builting rm doesn't work for some reason?
env rm -r ./depots env rm -r ./depots
let manifest = $info | get manifest | into int let manifest = $info | get manifest | into int
let date = $info | get date | into datetime | format date '%+' let date = $info | get date | into datetime | date to-timezone UTC | format date '%Y-%m-%dT%H:%M:%S'
{ {
app_id: $app, app_id: $app,