Skip to main content

Install the gateway with Nix

Run, install, or build the systemprompt.io gateway from the repo's Nix flake, including a NixOS module.

The template repo ships a flake at its root, so there is no external registry to add: you consume the gateway straight from GitHub. Builds are reproducible and pin to a commit or tag.

Pick Nix when you already use Nix or NixOS and want the gateway as a flake input, a profile package, or a locally reproducible build.

Run once (no install)

nix run github:systempromptio/systemprompt-template -- --help

Install into your profile

nix profile install github:systempromptio/systemprompt-template
systemprompt --version

Pin a version by appending a tag: nix run github:systempromptio/systemprompt-template/v0.2.2 -- --version.

NixOS module

Add the flake as an input and reference its default package in flake.nix:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    systemprompt.url = "github:systempromptio/systemprompt-template";
  };

  outputs = { self, nixpkgs, systemprompt, ... }: {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ pkgs, ... }: {
          environment.systemPackages = [
            systemprompt.packages.${pkgs.system}.default
          ];
        })
      ];
    };
  };
}

Development shell

The flake also exposes a dev shell with cargo, rustc, pkg-config, openssl, postgresql, just, and sqlx-cli on $PATH:

nix develop github:systempromptio/systemprompt-template

The gateway needs a Postgres database and at least one AI provider key at runtime; set DATABASE_URL and ANTHROPIC_API_KEY before starting. The API serves on port 8080.

Where to go next

For the local nix build flow and pinning details, see the full Nix recipe in the template repository. For Nix and flakes themselves, see the Nix documentation.