diff --git a/flake.nix b/flake.nix index 5ee8052..16e32bc 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,7 @@ "sourcemod-plugin-who" "sourcemod-plugin-afk" "sourcemod-plugin-demostf" + "sourcemod-plugin-properpregame" ] // { test = pkgs: @@ -83,7 +84,7 @@ sourcemod = true; plugins = with pkgs; [ sourcemod-plugin-soap-tf2dm - sourcemod-plugin-demostf + sourcemod-plugin-properpregame srctvplus ]; }; diff --git a/nix/sourcemod/plugins/builder/plugin.nix b/nix/sourcemod/plugins/builder/plugin.nix index dfe25b8..5d78c3e 100644 --- a/nix/sourcemod/plugins/builder/plugin.nix +++ b/nix/sourcemod/plugins/builder/plugin.nix @@ -13,6 +13,7 @@ lib.extendMkDerivation { installIncludes ? [], runtimeInputs ? [], src, + passthru ? {}, ... }: let inherit (lib) concatStringsSep map length optionalString; @@ -49,6 +50,10 @@ lib.extendMkDerivation { runHook postInstall ''; - passthru.runtimeInputs = runtimeInputs; + passthru = + passthru + // { + runtimeInputs = runtimeInputs; + }; }; } diff --git a/nix/sourcemod/plugins/overlay.nix b/nix/sourcemod/plugins/overlay.nix index 7195796..8d227af 100644 --- a/nix/sourcemod/plugins/overlay.nix +++ b/nix/sourcemod/plugins/overlay.nix @@ -16,4 +16,5 @@ final: prev: { sourcemod-plugin-who = final.callPackage ./who.nix {}; sourcemod-plugin-afk = final.callPackage ./afk.nix {}; sourcemod-plugin-demostf = final.callPackage ./demostf.nix {}; + sourcemod-plugin-properpregame = final.callPackage ./properpregame.nix {}; } diff --git a/nix/sourcemod/plugins/properpregame.nix b/nix/sourcemod/plugins/properpregame.nix new file mode 100644 index 0000000..2fd610d --- /dev/null +++ b/nix/sourcemod/plugins/properpregame.nix @@ -0,0 +1,33 @@ +{ + fetchFromGitHub, + mkSourcemodPlugin, + nix-update-script, + sourcemod-plugin-soap-tf2dm, +}: +mkSourcemodPlugin (finalAttrs: { + pname = "sourcemod-plugin-properpregame"; + version = "0-unstable-2020-06-06"; + src = fetchFromGitHub { + owner = "AJagger"; + repo = "ProperPregame"; + rev = "7698dabc7948f06d4821fc784c665ec4d8cacb5d"; + hash = "sha256-UfFmIsukf+v62317vqclMhT3zKLbL/qNrLJC296/8vw="; + }; + + plugins = ["addons/sourcemod/scripting/properpregame.sp"]; + runtimeInputs = [sourcemod-plugin-soap-tf2dm]; + + postInstall = '' + mkdir -p $out/cfg/sourcemod + cp cfg/sourcemod/* $out/cfg/sourcemod + ''; + + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--flake" + "--version=branch" + ]; + }; + }; +})