From 703a7cbb256b05155b1f24ab6bb2d6a4d8b44fd0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 8 Nov 2026 15:48:39 +0100 Subject: [PATCH] document flake module --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index c401677..5406e18 100644 --- a/README.md +++ b/README.md @@ -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 `` 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