updates, build fixes

This commit is contained in:
Robin Appelman 2026-11-20 22:40:15 +01:00
commit dcd65578b5
21 changed files with 179 additions and 175 deletions

12
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1783352529,
"narHash": "sha256-FZDPaZdAAjFbJWR/BoWCCVYB16WV0b472vhUPlQawh0=",
"lastModified": 1794865725,
"narHash": "sha256-YJ2D++LP38iOxALjoyU0+sLkB1DMzZC6LyyDFDNENXc=",
"owner": "nix-community",
"repo": "flakelight",
"rev": "da36ab2f725feb14b287ff1d6d56f6fc8ce6be5a",
"rev": "cc76eba994e4936c567d29a67add3649e882a534",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1783389287,
"narHash": "sha256-0xIy4dVLqq47rA+mRy0hXDfjhQd4E5PoIns/RmB7nR4=",
"lastModified": 1795137884,
"narHash": "sha256-iKXCN36qYfBni+3nH4vAd98/kshoIsPB2S9mYWhma30=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0ad6f47ea4fe188f4bc8f0380f93ae8523337c6c",
"rev": "ab5c18fdedfc8f9bbc9d773f10a540790e2787a7",
"type": "github"
},
"original": {

View file

@ -49,6 +49,7 @@
inheritPkgs [
"ambuild"
"sourcepawn"
"metamod-source"
"sourcemod"
"sourcemod-includes"
"sourcemod-include-curl"
@ -131,7 +132,7 @@
};
devShells.default = {pkgs, ...}: {
packages = with pkgs; [nix-update];
packages = with pkgs; [nix-update depotdownloader];
};
};
}

View file

@ -1,65 +1,45 @@
{
fetchFromGitHub,
fetchzip,
stdenv,
writeScript,
amtl,
ambuild,
sourcemod,
metamod-source,
sourcepawn,
boost186,
hl2sdk,
}: let
msinttypes = fetchzip {
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/msinttypes/msinttypes-r26.zip";
hash = "sha256-uMSuHXikaHQSt35FQ3o5uUjTjyP950O0DYTtQstbBvo=";
stripRoot = false;
ambuildArchs = {
"x86_64-linux" = "x64";
"i686-linux" = "x86";
};
ambuildArch = ambuildArchs.${stdenv.system};
in
stdenv.mkDerivation (finalAttrs: {
pname = "sourcemod-addon-socket";
version = "3.0.1";
version = "1.0.3";
src = fetchFromGitHub {
owner = "nefarius";
owner = "ProjectSky";
repo = "sm-ext-socket";
rev = "ed6bf7a12bd3f801610592301e12062b367fa27b";
hash = "sha256-M13Nt58tlXXBO1fB2Y3vQLyD4Wlzrwd6mHWSf5JTUwY=";
rev = finalAttrs.version;
hash = "sha256-9Y0r/hTNOqsccl6F1xgxuMWcT2GCy3r3OqiKElmpU2g=";
fetchSubmodules = true;
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail " -m32" "" \
--replace-fail "LINK = -lpthread -Wl,-Bstatic -static-libgcc -lboost_thread -lboost_system -lstdc++ -Wl,-Bdynamic" \
"LINK = -lpthread -lboost_thread -lstdc++" \
nativeBuildInputs = [ambuild];
substituteInPlace Socket.cpp \
--replace-fail "boost::system::posix_error" "boost::system::errc"
'';
nativebuildInputs = [
boost186
];
buildInputs = [
boost186
sourcemod.dev
amtl
msinttypes
sourcepawn.dev
metamod-source.dev
];
NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
installPhase = ''
runHook preInstall
mkdir -p $out/addons/sourcemod/extensions/x64
mkdir -p $out/addons/sourcemod/scripting/include
cp Release/socket.ext.so $out/addons/sourcemod/extensions/x64
cp socket.inc $out/addons/sourcemod/scripting/include
mkdir build
cd build
cp ../AMBuildScript ../../
python ../configure.py --enable-optimize --sm-path ${sourcemod.src} --targets ${ambuildArch}
ambuild
cp -r package $out
runHook postInstall
'';
passthru = {
updateScript = writeScript "update-null" "";
};
})

View file

@ -14,12 +14,12 @@
in
stdenv.mkDerivation (finalAttrs: {
pname = "sourcemod-addon-sourcetvmanager";
version = "1.3-beta1";
version = "1.3.0-beta00";
src = fetchFromGitHub {
owner = "peace-maker";
repo = "sourcetvmanager";
rev = "v${finalAttrs.version}";
hash = "sha256-4yhVwwouaMCvviwnuyhEMhzwZlBlObNZQg6KrMa86hQ=";
hash = "sha256-8tb9UPZS+5YuYuTXeyaQx85y4j56CBWEoTHfiXWPVvk=";
fetchSubmodules = true;
};

View file

@ -20,7 +20,7 @@ in
src = fetchFromGitHub {
owner = "moonexpr";
repo = "SteamWorks";
tag = "x86_64-support";
rev = "1dcfd1f232cb9783e3f30fb7f79401c4905e8a71";
hash = "sha256-SvyXsVL+JuJmxO0ox5fyAlmt9Ir52U/uCJ8HbUNA5Oc=";
};

View file

@ -7,13 +7,13 @@
}:
buildPythonPackage rec {
pname = "ambuild";
version = "2.2-unstable-2026-06-06";
version = "2.2-unstable-2026-11-08";
src = fetchFromGitHub {
owner = "alliedmodders";
repo = pname;
rev = "d89ec91a7ac2607da07b50bb62346f9a10e9a998";
hash = "sha256-AO9n+YaVaV9h2JNeaNKlLLPdXyA6HwQpcHCt0UCVIII=";
rev = "5b0aa725beef33c9cf6a1b00659a010c3d9120d3";
hash = "sha256-78jzcuMypwiDDmOqf3mKbkqHySUBGVG0xb4yY7un9EA=";
};
pyproject = true;

View file

@ -5,13 +5,13 @@
"platforms": ["i686-linux", "x86_64-linux"]
},
"tf2": {
"rev": "f8ec7a5644b58ff0c8dcd94d8b7501b447f5a82d",
"sha256": "sha256-xh8T8bzEUL23mGnpTA4xlhLeVkf9OxMp2MhaBlGayQ4=",
"rev": "631a7b6c0cbbb6941cf22e434620911a0bdfd478",
"sha256": "sha256-ImyBzhrKfk24yyvqrukRw+67IeAJ4Qf5mGg0vT1EJSU=",
"platforms": ["i686-linux", "x86_64-linux"]
},
"cs2": {
"rev": "f5836f20c033109d57fb08346bda80d614888488",
"sha256": "sha256-Gka6W6Oc7LMskOXvLNfVsHDU6FRa6bWSnVkqUSc0Mfg=",
"rev": "3f4110dce3060b352d49bf100f1a43f7705aab06",
"sha256": "sha256-axHPq5hUOFF6APR8auj9I1MBM8tj6Zm2vR/KVWZJZAI=",
"platforms": ["x86_64-linux"]
},
"swarm": {
@ -43,8 +43,8 @@
"platforms": ["i686-linux"]
},
"darkm": {
"rev": "016cfd4f95e58f94131594a12b5a3aac9cd33f20",
"sha256": "sha256-XX/IhmkVV31c25CdTTItAdcSds2ZlWMhqDzd34BcaoU=",
"rev": "6f0c3d9d8ef4fb1f897b2adfaec4226d7b0716d7",
"sha256": "sha256-fCC+xtamxTv5j/a2lqPnfP2G/AoZ8FY1OEulzaNF/II=",
"platforms": ["i686-linux"]
},
"eye": {
@ -53,8 +53,8 @@
"platforms": ["i686-linux"]
},
"bms": {
"rev": "51cd3e7b0b7fc81d672159c99299910a30b4c9ce",
"sha256": "sha256-RakfA20fk2VTtRne7NCl2UX8Q+5WRgeH5bBGIYe1f+Q=",
"rev": "69fe26fed5ad34cb6ef032c57a54f8efbcdd8849",
"sha256": "sha256-2RmGeUlny9K4oCa1jBxEpKnnozsIRZAQls1V/RUngqI=",
"platforms": ["i686-linux"]
},
"l4d": {
@ -78,8 +78,8 @@
"platforms": ["i686-linux"]
},
"pvkii": {
"rev": "f06b74a1d44116613e398787974b78e51fb1c8b8",
"sha256": "sha256-wfgTfFuxYCHdMzuvI5w/Xw/MGVYWmsWB7uWtttShHTM=",
"rev": "f65b48326a73aafe9f15eb238c2fe3fe4c82d0d1",
"sha256": "sha256-hKWB5Nq+hoe8Q623fLann1pLuktfHOck2u5O4joG1+Y=",
"platforms": ["i686-linux"]
},
"episode1": {
@ -88,38 +88,38 @@
"platforms": ["i686-linux"]
},
"dota": {
"rev": "ab11e586227623183bf6e7fa5e988fcb71080efb",
"sha256": "sha256-X5aqTMFTf9TjZS17pWh84KNshQ5F68r0tnX6hD/glNA=",
"rev": "00edcdc8173a29b433d772dccf8338b8c876d0ab",
"sha256": "sha256-J8TTzVysgNIhwLvWFrYGFZvrWJN2YkHcdXdGHFzYUF8=",
"platforms": ["i686-linux"]
},
"mcv": {
"rev": "0b085deb66af320cee4046d5f5a89dfb044a2811",
"sha256": "sha256-stg1NVl+l5/MjeY8lVrSR/OVsBHyT2do6VEcOPNF9MY=",
"rev": "e83260bc8de65d07a5fb73b5c2686a98e9927b2e",
"sha256": "sha256-sahlVB57wB1SdhbgUyLSGyz7auu5mdKcKnNkab8Owxo=",
"platforms": ["i686-linux"]
},
"dods": {
"rev": "ece187a8147a8159c16f88305e3523cef6475ecf",
"sha256": "sha256-GAVs8ENKFde9BPQx9VAqdlFRiYe4DfbTHs8I+KJpoyc=",
"rev": "cbc97391097ed5c2790ab3fac6f9d05661d3a10f",
"sha256": "sha256-fPhI70N4iuQWc7kHExldrUpHU4uxr1zdHx0d04sPmJs=",
"platforms": ["i686-linux", "x86_64-linux"]
},
"sdk2013": {
"rev": "4c56ee5bc8bfe00793abb7d40eb3f6fb040f10d2",
"sha256": "sha256-aWrQt7XIpXiomDICcSSqyxYsRZgpHnwX7eIX4o2V5jE=",
"rev": "7c5bfe038ec70f11814b5d15c4ca9b6403e97b05",
"sha256": "sha256-ckvEgdyOsu2tsDIQYP/ALLvJkKOlUv6URBoFqHeBfHA=",
"platforms": ["i686-linux", "x86_64-linux"]
},
"hl2dm": {
"rev": "af883d5052349f09fbe641c99149b84769a62d01",
"sha256": "sha256-GAVs8ENKFde9BPQx9VAqdlFRiYe4DfbTHs8I+KJpoyc=",
"rev": "11dca0f12e53089b9dee6511f6b8ff4d02c9d51d",
"sha256": "sha256-Mof4QQDi67KumtZwegUtUly3btKtCrLZN7hXnRo+9ZI=",
"platforms": ["i686-linux", "x86_64-linux"]
},
"l4d2": {
"rev": "f48f11d80d599b41f75c506c2edfc81fe9935e9a",
"sha256": "sha256-cp0h2YlWSIfRyh+amIV8kyBLJ/oIXOkG7zsH3Wx8zZI=",
"rev": "ee978cde412bb8720453f1f89e5748ec1449a4b3",
"sha256": "sha256-fCVl6M5egu3adxA/9dQxokPx5gq9pKv7fLAbv+I73FA=",
"platforms": ["i686-linux"]
},
"css": {
"rev": "64895cf48c68f5cef0470ee3f13ec449babc30ea",
"sha256": "sha256-8+k8Vg5R5/2kUcTSLRTY71rZ+MvCuSppLcfD+aUVuW0=",
"rev": "47f0ea659bc70718f9c41a7830b6ad943a68ba09",
"sha256": "sha256-fPhI70N4iuQWc7kHExldrUpHU4uxr1zdHx0d04sPmJs=",
"platforms": ["i686-linux", "x86_64-linux"]
},
"doi": {
@ -128,8 +128,8 @@
"platforms": ["i686-linux"]
},
"deadlock": {
"rev": "0af9332394a4eb3fb904610543d266f54b7ad820",
"sha256": "sha256-WbOVrECtCKUwZEdoGV9c80t3gU6WopKVS89N7cKdhjg=",
"rev": "a3c3c30d717037a92deea204c1bc748823f8ed31",
"sha256": "sha256-XEgahMqrhE+RK5LdutKkRpVioXzifqNLKjzgGtdTBlo=",
"platforms": ["x86_64-linux"]
}
}

View file

@ -5,13 +5,13 @@
}:
stdenv.mkDerivation {
pname = "sourcemod-includes";
version = "1.12.0.7239";
version = "1.12.0.7260";
src = fetchFromGitHub {
owner = "alliedmodders";
repo = "sourcemod";
rev = "b951843d42f7b9204615c14885468ea131a24002";
hash = "sha256-GlAi9V78uTSyOfMfHVtEq+RYM31Y0SOUllGXUI2rYGU=";
rev = "3f7460671f7adc4a3c6791a47d21ba3e7b5fba91";
hash = "sha256-bz+/A32iqgl0VPFCdP7SYFqO3wEOjSMkQaVlpSRiRG0=";
};
doConfigure = false;

View file

@ -5,6 +5,7 @@
git,
fetchpatch2,
symlinkJoin,
nix-update-script,
}: sdks: let
inherit (builtins) attrNames concatStringsSep attrValues;
sdkNames = concatStringsSep "," (attrNames sdks);
@ -57,4 +58,13 @@ in
cp -r $src/public $dev/public
ln -s $dev/public $dev/include
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--flake"
"--use-github-releases"
];
};
};
})

View file

@ -1,7 +1,7 @@
{mkSpirePlugin}:
mkSpirePlugin {
name = "autoexec";
version = "0.2-unstable-2026-02-03";
rev = "9ef880d8cd3d2ad362aa42d7f8a77a8161cabb4d";
hash = "sha256-RxQzFMSudQIOa6f/qaCjPS4qA1cgx0voZYBcHhe2UpU=";
version = "0.2-unstable-2026-07-23";
rev = "f637234a5defc5c93360e09e06c935ad7ebdb48f";
hash = "sha256-KP6CADRrzhPRqEw5sPajW5kWTJsUpkfPbWyWp9cIpyA=";
}

View file

@ -1,11 +1,12 @@
{
mkSpirePlugin,
sourcemod-addon-curl,
sourcemod-include-curl,
sourcemod-include-json,
}:
mkSpirePlugin {
name = "banned";
version = "0-unstable-2026-06-18";
rev = "c8186c7bd56e15f2e2e8e5988c0d18058a02df8b";
hash = "sha256-JA9WeM0Je0aHB/z+6xImztTouJNGkaPwD9Cp4z8Ko+4=";
runtimeInputs = [sourcemod-addon-curl];
version = "0-unstable-2026-11-18";
rev = "184accea521e36fff2fa05d4c10719384c939e2c";
hash = "sha256-+xHA5awx0JEM6uyZOfLVjBVPQYt4uIb96xZpIAQIMAo=";
runtimeInputs = [sourcemod-include-curl sourcemod-include-json];
}

View file

@ -24,12 +24,12 @@ lib.extendMkDerivation {
};
in {
pname = "sourcemod-plugin-${name}";
version = "20260702-1782977488895-unstable-2026-07-02";
version = "20261120-1795172513591-unstable-2026-11-20";
src = fetchFromGitHub {
owner = "F2";
repo = "F2s-sourcemod-plugins";
rev = "2be8d34329603569a2848f66b68f3ca323c9d937";
hash = "sha256-XN/LBD3P3tWTI9xwO0+a6+dRH4kyDUTNhGWs2FCCHd0=";
rev = "7c7b22e7daf6e7aae877a4ba48c08eb8fb572cfc";
hash = "sha256-se9g5lFXzj75gLHPFiyEyh29DtQ9uFFE23741LaGF/Q=";
};
plugins = ["${name}/${name}.sp"];

View file

@ -6,7 +6,7 @@
}:
mkSourcemodPlugin (finalAttrs: {
pname = "sourcemod-plugin-demostf";
version = "1.18.1";
version = "0-unstable-2024-01-27";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "demostf";

View file

@ -5,20 +5,16 @@
}:
mkSourcemodPlugin (finalAttrs: {
pname = "sourcemod-plugin-extend-humiliation";
version = "0-unstable-2026-07-10";
version = "0-unstable-2026-11-20";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "spire";
repo = "docker-comp-server";
rev = "1c0884386cf97d61e0699cffb072fbabdfc59cbf";
hash = "sha256-IKtDtcQhvoexuMSJcgkmNMVrfcBapM6NTar96CMzyvc=";
rev = "a7c238096c140fedb42ee6cbe3d8c8cbd743cef4";
hash = "sha256-KmL7NuXWwiHpANxkgP9kH3e//X+rregmmZMKRgwg08Q=";
};
preInstall = ''
rm pause.smx
'';
plugins = ["ExtendHumiliation.sp"];
plugins = ["plugin/ExtendHumiliation.sp"];
passthru = {
updateScript = nix-update-script {

View file

@ -4,8 +4,8 @@
}:
mkSpirePlugin {
name = "mapdownloader";
version = "0-unstable-2025-10-27";
rev = "06dbac41712bd62ae3aa1fd442ab2265ee2f488f";
hash = "sha256-aNlrxrv2K73lKP7hYOER3um4P6fbiV/nF4GDcVaUNbo=";
version = "0-unstable-2026-10-14";
rev = "ef51d4c9fc778dd7d89b87a4cd08e197b7f7304f";
hash = "sha256-y36ZlM2wMIfDuoOgUXO+6ys2TTd4TutNZAtSjgqL3gA=";
runtimeInputs = [sourcemod-addon-curl];
}

View file

@ -1,7 +1,7 @@
{mkSpirePlugin}:
mkSpirePlugin {
name = "nochat";
version = "0-unstable-2026-03-28";
rev = "7c161d4eef058bf3e59146a37ff6ca16594e013b";
hash = "sha256-cO64QGlM8oGVGaDgac74VjIFLrNe8aPrOo3tvrSD4Eo=";
version = "0-unstable-2026-10-28";
rev = "9fdf278be98f67ec1f24d84c3c2ae1fb9bcd8f18";
hash = "sha256-nhfSLzCLVZlEcDUY5iwnzTCxbKnr3+PqMw9LwfYHtak=";
}

View file

@ -7,10 +7,10 @@
}:
mkSourcemodPlugin (finalAttrs: {
pname = "sourcemod-plugin-soap-tf2dm";
version = "4.4.8";
version = "4.5.0b";
src = fetchzip {
url = "https://github.com/sapphonie/SOAP-TF2DM/releases/download/v${finalAttrs.version}/soap.zip";
sha256 = "sha256-7tzYmJn7iUCwKwni2zZCxDAwixoxyW5iXZ82ppsUxE8=";
sha256 = "sha256-JxBnOTf5s4/CCZnEHlcB5lrl13uAyrmx/XzUwc7a378=";
stripRoot = false;
};

View file

@ -7,7 +7,7 @@
lib,
writeShellScriptBin,
zlib,
writeScript,
nix-update-script,
}: sdks: let
inherit (builtins) concatStringsSep attrNames attrValues;
inherit (lib) optionals;
@ -26,15 +26,15 @@
in
stdenv.mkDerivation (finalAttrs: {
pname = "sourcemod";
version = "1.12.0.7239";
version = "1.12.0.7260";
outputs = ["out" "dev"];
src = fetchFromGitHub {
owner = "alliedmodders";
repo = finalAttrs.pname;
rev = "b951843d42f7b9204615c14885468ea131a24002";
sha256 = "sha256-aulM6fzXcmQf0xztWDRyxbH02mTGJKPMqpUMUSeNbaM=";
repo = "sourcemod";
rev = finalAttrs.version;
sha256 = "sha256-FCaQeHOBWYD41JLRJHxH+qlcdrfZtLRLtv5/nAriVhQ=";
fetchSubmodules = true;
};
@ -72,26 +72,12 @@ in
ln -s $dev/public $dev/include
'';
passthru.updateScript = writeScript "update-sourcemod" ''
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nurl common-updater-scripts
let html = http get https://www.sourcemod.net/downloads.php?branch=stable
let branch = $html | query web --query h3 | first | first | parse --regex "from (?P<branch>[0-9.]+) Branch" | get branch | first
let build = $html | query web --as-table [Build] | get 1 | get Build | first
let newRev = $html | query web --query 'td a[href^="https://github.com/alliedmodders/sourcemod/tree/"]' --attribute ['href'] | first | get href | split words | last
let oldHash = nix eval --raw .#sourcemod.src.hash
let oldRev = nix eval --raw .#sourcemod.src.rev
let oldVersion = nix eval --raw .#sourcemod.version
let newHash = nurl https://github.com/alliedmodders/sourcemod $newRev --submodules --hash
let newVersion = $"($branch).0.($build)"
let nix = open nix/sourcemod/sourcemod.nix |
str replace $oldHash $newHash |
str replace $oldVersion $newVersion |
str replace $oldRev $newRev
$nix | save -f nix/sourcemod/sourcemod.nix
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--flake"
"--use-github-releases"
];
};
};
})

View file

@ -12,6 +12,7 @@
sourcemod-include-steamworks,
sourcemod-include-json,
runCommand,
sourcemod,
}: let
inherit (builtins) concatStringsSep substring stringLength;
self = stdenv.mkDerivation rec {
@ -20,15 +21,10 @@
outputs = ["out" "dev"];
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=ignored-attributes -Wno-error=deprecated-declarations";
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=ignored-attributes -Wno-error=deprecated-declarations -Wno-error=unused-variable";
src = fetchFromGitHub {
owner = "alliedmodders";
repo = pname;
rev = "eef61ffc069238a00c89b54b63813b6861b21c47";
hash = "sha256-Vuq3oJM3HvfA5VHTcOcvwLQQ2orHs+S+2OkMejUFChU=";
fetchSubmodules = true;
};
# always keep sourcemod and sourcepawn in sync
src = sourcemod.src + "/sourcepawn";
buildInputs = [
ambuild

View file

@ -2,16 +2,16 @@
{
"app_id": 232250,
"depot_id": 232256,
"manifest": 698669566371320345,
"date": "2026-07-03T17:53:32",
"hash": "sha256-PNG0Xz08ozVjqYN2XZHr1/4TmrITIZA0kLax3LGMqZY="
"manifest": 8265263630080743034,
"date": "2026-10-16T17:05:15",
"hash": "sha256-wTuQGShqCWQ0Pc2KBbDPvu2sb8VMUF4dz6Z23+BMRXY="
},
{
"app_id": 232250,
"depot_id": 232250,
"manifest": 2913732008368787064,
"date": "2026-07-08T20:53:13",
"hash": "sha256-MW3TUtfNn7iOGfEcdIDCjWbd0HFYv4Tk2gUef3eyYCo=",
"manifest": 5757605357257765879,
"date": "2026-10-30T20:10:04",
"hash": "sha256-1sXc4P3JOZr4VBEjEMNMaTlyekc3afNGbs72IQKYsTI=",
"file_list": [
"regex:^[^.]*(\\.(?!bsp$)[^.]+(.[^.]+)?)?$",
"tf/maps/cp_badlands.bsp"

View file

@ -1,32 +1,68 @@
#! /usr/bin/env nu
def main [] {
# update_all_depots
# 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 --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}
# 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
list_plugins | each {|plugin| nix-update --flake --use-update-script $"sourcemod-plugin-($plugin)"}
# all F2 plugins are updated in one go
nix-update --flake --use-update-script sourcemod-plugin-afk
def main [what: string = "all"] {
match $what {
"all" => {
update_all_depots
update_sourcemod
update_sdks
update_addons
update_includes
update_plugins
},
"depots" => update_all_depots,
"sourcemod" => update_sourcemod,
"sdks" => update_sdks,
"addons" => update_addons,
"includes" => update_includes,
"plugins" => update_plugins,
}
nix fmt
}
def update_sourcemod [] {
print "Updating sourcemod..."
nix-update --flake --use-update-script ambuild
nix build .#ambuild
nix-update --flake --use-update-script sourcemod metamod-source
nix build .#metamods.x86_64-linux.tf2
nix-update --flake --use-update-script sourcemod
nix build .#sourcepawn
nix build .#sourcemods.x86_64-linux.tf2
}
def update_plugins [] {
print "Updating plugins..."
list_plugins | each {|plugin|
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-update --flake --use-update-script $"sourcemod-plugin-($plugin)"
nix build $".#sourcemod-plugin-($plugin)" --option system i686-linux
}
# all F2 plugins are updated in one go
nix-update --flake --use-update-script sourcemod-plugin-afk
}
def update_addons [] {
print "Updating addons..."
list_addons | each {|plugin| nix-update --flake --use-update-script $"sourcemod-addon-($plugin)"}
}
def update_includes [] {
print "Updating 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
}
def update_sdks [] {
print "Updating sdks..."
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
@ -38,13 +74,6 @@ def update_sdk [sdk: string] {
nix build .#sourcemods.x86_64-linux.tf2
}
def get_metamod_version [] {
let html = http get https://www.metamodsource.net/downloads.php/?branch=stable
let branch = $html | query web --query h3 | first | first | parse --regex "from (?P<branch>[0-9.]+) Branch" | get branch | first
let build = $html | query web --as-table [Build] | get Build | first
$"($branch).0.($build)"
}
def get_manifest [app: int, depot: int] {
let info = DepotDownloader -app $app -depot $depot -manifest-only | parse -r 'Manifest (?P<manifest>[0-9]+) \((?P<date>[^)]+)\)' | first
# builting rm doesn't work for some reason?
@ -61,6 +90,7 @@ def get_manifest [app: int, depot: int] {
}
def update_all_depots [] {
print "Updating depots..."
let $depots = open nix/srcds/depots.json
let updated = $depots | each {|manifest| update_manifest $manifest}
@ -101,3 +131,7 @@ def extract_hash [] {
def list_plugins [] {
ls -s nix/sourcemod/plugins/ | where type == file and ($it.name | str ends-with '.nix') and ($it.name != 'overlay.nix') | get name | str substring 0..-5
}
def list_addons [] {
ls -s nix/sourcemod/addons/ | where type == file and ($it.name | str ends-with '.nix') and ($it.name != 'overlay.nix') | get name | str substring 0..-5
}