diff options
author | yuuko <yuuko@partyvan.io> | 2024-08-30 21:14:22 -0700 |
---|---|---|
committer | yuuko <yuuko@partyvan.io> | 2024-08-30 21:16:25 -0700 |
commit | 402758f0494c2e4826605b36a93bbbe703db9cbd (patch) | |
tree | 173be9f7fedd188c3167256b69ec90f0f9d9540f /srcds-pkgs/sourcemod/with-plugins.nix | |
parent | 56449e59d7aabd1c06fb67a51a1e129b55cb9270 (diff) |
add sourcemodWithPackages, fix plugin build
Diffstat (limited to 'srcds-pkgs/sourcemod/with-plugins.nix')
-rw-r--r-- | srcds-pkgs/sourcemod/with-plugins.nix | 29 |
1 files changed, 29 insertions, 0 deletions
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} + ''; +}) |