A Nix flake for pi, the terminal coding agent.
It provides:
- packages for
nix run/nix build - NixOS and Home Manager modules
- an overlay exposing
pkgs.pi-coding-agent lib.mkCodingAgentfor building a configured wrapper
Important
This is not the official Nix flake for pi (there isn't one). See earendil-works/pi#2310 for context.
nix run github:lukasl-dev/pi.nix --accept-flake-configOr build it locally:
nix build .#coding-agent --accept-flake-config{
inputs.pi.url = "github:lukasl-dev/pi.nix";
}Build results are pushed to pi.cachix.org. The flake declares the substituter and public key via nixConfig, so consumers can use --accept-flake-config or configure it explicitly:
nix.settings = {
extra-substituters = [ "https://pi.cachix.org" ];
extra-trusted-public-keys = [
"pi.cachix.org-1:lGeoGJaZ5ZDabuRzkcD5EBTNnDM4HJ1vqeOxlWk1Flk="
];
};{ inputs, config, ... }:
{
imports = [ inputs.pi.nixosModules.default ];
programs.pi.coding-agent = {
enable = true;
# users = [ "lukas" ]; # defaults to all normal users
# rules = ''Be concise.'';
# skills = [ ./skills/my-skill ];
# extensions = [ ./extensions/my-extension.ts ];
# themes = [ ./themes/catppuccin-mocha.json ];
# promptTemplates = [ ./prompts ];
# models = ./models.json;
# extraArgs = [ "--provider" "openai" "--model" "gpt-5" ];
# environment.OPENAI_API_KEY = config.age.secrets.openai.path;
};
}{ inputs, config, ... }:
{
imports = [ inputs.pi.homeModules.default ];
programs.pi.coding-agent = {
enable = true;
# rules = ''Be concise.'';
# skills = [ ./skills/my-skill ];
# models = ./models.json;
# environment.OPENAI_API_KEY = config.age.secrets.openai.path;
};
}{ inputs, pkgs, ... }:
{
nixpkgs.overlays = [ inputs.pi.overlays.default ];
environment.systemPackages = [ pkgs.pi-coding-agent ];
}{ inputs, pkgs, ... }:
let
pi = inputs.pi.lib.mkCodingAgent {
inherit pkgs;
modules = [{
pi.coding-agent = {
rules = ''Be concise.'';
skills = [ ./skills/my-skill ];
extraArgs = [ "--provider" "openai" "--model" "gpt-5" ];
};
}];
};
in
pi.packageCommon options under programs.pi.coding-agent / pi.coding-agent:
enablepackagerulesskillsextensionsthemespromptTemplatesmodels(NixOS/Home Manager modules only)users(NixOS module only)extraArgsenvironment