From 7fbb26a81a847c548fbec731345e3b7840c84ba5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 8 Jul 2026 21:29:52 +0200 Subject: [PATCH] add script to update all sdks --- README.md | 2 +- nix/sourcemod/hl2sdk.nix | 2 +- update-all.nu | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 update-all.nu diff --git a/README.md b/README.md index 467485f..3d1e21c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ sourcemod doesn't support all of them. #### i686-linux -`episode1`, `ep2`, `css`, `hl2dm`, `dods`, `sdk2013`, `tf2`, `l4d`, `l4d2`, +`episode1`, `orangebox`, `css`, `hl2dm`, `dods`, `sdk2013`, `tf2`, `l4d`, `l4d2`, `nucleardawn`, `csgo`, `insurgency`, `bms` and `doi` #### x86_64-linux diff --git a/nix/sourcemod/hl2sdk.nix b/nix/sourcemod/hl2sdk.nix index f8beb27..bc41be7 100644 --- a/nix/sourcemod/hl2sdk.nix +++ b/nix/sourcemod/hl2sdk.nix @@ -8,7 +8,7 @@ inherit (lib) optionals importJSON; revisions = importJSON ./hl2sdks.json; # from https://github.com/alliedmodders/hl2sdk-manifests/tree/master/manifests - linuxX86Sdks = ["episode1" "ep2" "css" "hl2dm" "dods" "sdk2013" "tf2" "l4d" "l4d2" "nucleardawn" "csgo" "insurgency" "bms" "doi"]; + linuxX86Sdks = ["episode1" "orangebox" "css" "hl2dm" "dods" "sdk2013" "tf2" "l4d" "l4d2" "nucleardawn" "csgo" "insurgency" "bms" "doi"]; linuxX64Sdks = ["mcv" "blade" "csgo" "tf2" "cs2" "sdk2013" "dota" "dods" "hl2dm" "deadlock" "insurgency" "css"]; isX86 = name: elem name linuxX86Sdks; isX64 = name: elem name linuxX64Sdks; diff --git a/update-all.nu b/update-all.nu new file mode 100755 index 0000000..10a2605 --- /dev/null +++ b/update-all.nu @@ -0,0 +1,17 @@ +#! /usr/bin/env nu + +def main [] { + let sdks = open nix/sourcemod/hl2sdks.json | columns + $sdks | each {|sdk| update_sdk $sdk} +} + +def update_sdk [sdk: string] { + print $"Updating ($sdk) SDK" + # some sdks might have identical files at some point, so their hash can be the same + # nix-update will replace all occurences of the hash, which might not be correct + # so we put a unique dummy value in there to work around this + open nix/sourcemod/hl2sdks.json | update ([$sdk, "sha256"] | into cell-path) $"($sdk)-placeholder" | save -f nix/sourcemod/hl2sdks.json + + nix-update --flake --use-update-script $"hl2sdk.($sdk)" + nix build .#sourcemods.x86_64-linux.tf2 +}