From 3c3bf63ddfabc33693d978d619eff257a8cb9274 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 9 Jul 2026 15:07:52 +0200 Subject: [PATCH] improve srcds time/versioning --- nix/srcds/default.nix | 12 ++++++------ update-all.nu | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/nix/srcds/default.nix b/nix/srcds/default.nix index 8bc31c9..855edf0 100644 --- a/nix/srcds/default.nix +++ b/nix/srcds/default.nix @@ -11,8 +11,8 @@ steamworks-sdk-redist, system, }: let - inherit (builtins) fromJSON readFile map toString elem head replaceStrings; - depotInputs = fromJSON (readFile ./depots.json); + inherit (lib) importJSON map toString elem last replaceStrings naturalSort; + depotInputs = importJSON ./depots.json; fetchSupported = elem system depotdownloader.meta.platforms; fetcher = input: if fetchSupported @@ -49,8 +49,9 @@ name = "srcds-tf2-src"; paths = allDepots; }; - timeToVersion = replaceStrings ["T" ":" "Z"] ["-" "-" ""]; - time = (head depotInputs).date; + timeToVersion = replaceStrings ["T" ":"] ["-" "-"]; + times = map (depot: depot.date) depotInputs; + time = last (naturalSort times); curlCompat = curlWithGnuTls.overrideAttrs ( final: prev: { @@ -82,8 +83,7 @@ in chmod -R +w $out # the steamclient.so included in the depot is 32bit so it wont work - cp ${steamworks-sdk-redist}/lib/steamclient.so $out/bin/steamclient.so - chmod -R +w $out/bin/steamclient.so + cp ${steamworks-sdk-redist}/lib/steamclient.so $out/bin/linux64/steamclient.so echo 440 > $out/steam_appid.txt diff --git a/update-all.nu b/update-all.nu index c922938..6958038 100755 --- a/update-all.nu +++ b/update-all.nu @@ -3,22 +3,22 @@ def main [] { update_all_depots - nix-update --flake --use-update-script ambuild - nix build .#ambuild + # nix-update --flake --use-update-script ambuild + # nix build .#ambuild - nix-update --flake --version=$"(get_metamod_version)" metamod-source - nix build .#metamods.x86_64-linux.tf2 + # nix-update --flake --version=$"(get_metamod_version)" metamod-source + # nix build .#metamods.x86_64-linux.tf2 - nix-update --flake --use-update-script sourcemod - nix build .#sourcemods.x86_64-linux.tf2 + # nix-update --flake --use-update-script sourcemod + # nix build .#sourcemods.x86_64-linux.tf2 - let sdks = open nix/sourcemod/hl2sdks.json | columns - $sdks | each {|sdk| update_sdk $sdk} + # let sdks = open nix/sourcemod/hl2sdks.json | columns + # $sdks | each {|sdk| update_sdk $sdk} - 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-steamworks - nix-update --flake --use-update-script sourcemod-includes + # 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-steamworks + # nix-update --flake --use-update-script sourcemod-includes nix fmt } @@ -46,7 +46,7 @@ def get_manifest [app: int, depot: int] { # builting rm doesn't work for some reason? env rm -r ./depots 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,