From 402758f0494c2e4826605b36a93bbbe703db9cbd Mon Sep 17 00:00:00 2001 From: yuuko Date: Fri, 30 Aug 2024 21:14:22 -0700 Subject: add sourcemodWithPackages, fix plugin build --- srcds-pkgs/sourcemod/with-plugins.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 srcds-pkgs/sourcemod/with-plugins.nix (limited to 'srcds-pkgs/sourcemod') diff --git a/srcds-pkgs/sourcemod/with-plugins.nix b/srcds-pkgs/sourcemod/with-plugins.nix new file mode 100644 index 0000000..2a9ed9d --- /dev/null +++ b/srcds-pkgs/sourcemod/with-plugins.nix @@ -0,0 +1,29 @@ +{ sourcemod, metamod-source +, symlinkJoin +}: +{ configs ? [] +, postBuild ? "" +, plugins ? [] +, enabledPlugins ? [] +, name ? "sourcemodWithPlugins" +}@args: +symlinkJoin (args // { + paths = configs ++ [ metamod-source sourcemod ] ++ plugins; + inherit name; + postBuild = '' + if [ -n "''${enabledPlugins:-}" ]; then + pushd $out/share/addons/sourcemod/plugins + mkdir -p disabled + for plug in $enabledPlugins; do + fp=disabled/"$plug.smx" + [ -e "$fp" ] || { + echo "No such plugin $fp" >&2 + exit 1 + } + ln -s "$fp" ./ + done + popd + fi + ${postBuild} + ''; +}) -- cgit v1.2.3