A set of tf2 related nix packages
  • Nix 92.2%
  • Nushell 7.8%
Find a file
2026-07-10 16:40:22 +02:00
.forgejo/workflows build less sourcemods in ci 2026-07-09 19:04:44 +02:00
nix fix soap-tf2dm 2026-07-10 16:40:22 +02:00
.envrc init 2023-07-08 17:23:51 +02:00
.gitignore sourcemod-addon-socket from source 2026-07-10 02:20:34 +02:00
flake.lock flake update 2026-07-08 13:35:10 +02:00
flake.nix fix soap-tf2dm 2026-07-10 16:40:22 +02:00
README.md update scripts for depots 2026-07-09 00:18:04 +02:00
update-all.nu update all plugins with script 2026-07-09 19:33:51 +02:00

Spire nix packages

A set of tf2 related nix packages

Packages

The following is currently packaged:

TF2 Dedicated server

The srcds-tf2 package contains the TF2 dedicated server.

You can start a basic server with nix run .#srcds-tf2 -- -enablefakeip +map cp_badlands, once it's done loading you can get the SDR ip using status (it will start with 169.254), and connect to it from your client.

Writable tf directory

When running the server directly from the nix store, the tf directory will be read only. Which is likely to cause issues as various things try to write to the directory during normal operations. To work around this, you can either copy it out of the nix store into a normal directory and make it writable, setup a writable overlayfs, or try to configure tf2 to only write outside the tf directory (unsure if this is feasible).

Maps

To save space, cp_badlands is the only map bundled with srcds-tf2. If you need additional maps you need to either manually add them to the server, or use a plugin like mapdownloader to automatically download maps on demand;

Sourcemod SDKs

For the sourcemod package, you need to enable one or more SDKs at build time. The SDKs are packaged under the hl2sdk package and can be enabled like in the following example.

pkgs.sourcemod.override {sdks = {inherit (pkgs.hl2sdk) tf2;};};

Supported SDKs

Note that while all the sdks listed below are all packages under hl2sdk, sourcemod doesn't support all of them.

i686-linux

episode1, orangebox, css, hl2dm, dods, sdk2013, tf2, l4d, l4d2, nucleardawn, csgo, insurgency, bms and doi

x86_64-linux

mcv, blade, csgo, tf2, cs2, sdk2013, dota, dods, hl2dm, deadlock, insurgency and css

Building sourcepawn script

buildSourcePawnScript {
  name = "test";
  src = ./test.sp;
};

By default, the sourcemod includes are available.

Additional includes can be added by setting the includes argument to an array of packages containing an include folder containing the .inc files. This flake packages a number of common includes and a helper is provided to create include packages:

sourcepawn.buildInclude [./cURL.inc ./cURL_header.inc]
buildSourcePawnScript {
  name = "test";
  src = ./test.sp;
  includes = [
    pkgs.sourcemod-include-curl
    (
      sourcepawn.buildInclude [./custom.inc]
    )
  ];
};