diff --git a/flake.nix b/flake.nix index d569046..38618e9 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,7 @@ "sourcemod-include-library" "sourcemod-include-steamworks" "srcds-tf2" + "srctvplus" "sourcemod-addon-curl" "sourcemod-addon-steamworks" "sourcemod-addon-socket" @@ -81,6 +82,7 @@ sourcemod = true; plugins = with pkgs; [ sourcemod-plugin-soap-tf2dm + srctvplus ]; }; testScript = pkgs: diff --git a/nix/srcds/overlay.nix b/nix/srcds/overlay.nix index 197be17..e1753c2 100644 --- a/nix/srcds/overlay.nix +++ b/nix/srcds/overlay.nix @@ -17,6 +17,7 @@ in { gamedir = "tf"; sdk = "tf2"; }; + srctvplus = final.callPackage ./srctvplus.nix {}; steam-depots = listToAttrs (map (depot: { name = "steam-depot-${toString depot.app_id}-${toString depot.depot_id}"; value = final.callPackage ./depot.nix { diff --git a/nix/srcds/srctvplus.nix b/nix/srcds/srctvplus.nix new file mode 100644 index 0000000..bb67476 --- /dev/null +++ b/nix/srcds/srctvplus.nix @@ -0,0 +1,51 @@ +{ + fetchFromGitHub, + stdenv, + nix-update-script, + prelink, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "srctvplus"; + version = "3.0"; + src = fetchFromGitHub { + owner = "dalegaard"; + repo = "srctvplus"; + rev = "v${finalAttrs.version}"; + hash = "sha256-vywrMllBxWf0TUShHJvfRCb4NXXrmiumG8AxNWooSMA="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + prelink + ]; + + NIX_CFLAGS_COMPILE = "-ftrampoline-impl=heap"; + + buildPhase = '' + runHook preBuild + + bash build.sh + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/addons + execstack -c srctvplus.so + cp srctvplus.vdf srctvplus.so $out/addons + + runHook postInstall + ''; + + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--flake" + ]; + }; + }; + + meta.platforms = ["i686-linux"]; +})