document flake module

This commit is contained in:
Robin Appelman 2026-11-08 15:48:39 +01:00
commit 703a7cbb25
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE

View file

@ -65,6 +65,43 @@ sourcemod doesn't support all of them.
`mcv`, `blade`, `csgo`, `tf2`, `cs2`, `sdk2013`, `dota`, `dods`, `hl2dm`,
`deadlock`, `insurgency` and `css`
## Flake framework
This repository contains a batteries-included flake framework based on
[flakelight](https://github.com/nix-community/flakelight).
```nix
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/release-26.05";
flakelight.url = "github:nix-community/flakelight";
spire.url = "git+https://codeberg.org/spire/nix";
flakelight.inputs.nixpkgs.follows = "nixpkgs";
spire.inputs.flakelight.follows = "flakelight";
};
outputs =
{ spire, ... }:
spire ./. {
# optional if you only need the `<sourcemod>` include.
includes =
includes: (with includes; [
curl
json
]);
# defaults to ./plugin
pluginDir = ./my-plugin-directory;
};
}
```
This will create a package for every `.sp` file in the plugin directory (named
after the filename), and a `default` package containing all the plugins in the
directory.
Additionally it sets up a devshell with `spcomp` with the chosen includes.
## Building sourcepawn script
```nix