How to install Pi coding agent on NixOS with Home Manager

I’ve made pi-coding-agent using nix flake. Here is my guide on how to implement it.

# In your flake.nix
inputs.pi-flake.url = "github:ChauDucToan/pi-flake";

I’ve made module for both nixpkgs and home-manager. These two are quite similar to each other so i’m using home-manager one as example:

# In your home.nix
{ inputs, pkgs, ... }:
{
  imports = [
    inputs.pi-flake.homeManagerModules.default
  ];

  programs.pi-coding-agent = {
    enable = true;

    package = inputs.pi-flake.packages.${pkgs.stdenv.hostPlatform.system}.default;

    mutableDir = true;

    models = {
      providers = {
        my-provider = {
          baseUrl = "https://api.openai.com/v1";
          api = "openai-completions";
          apiKey = "sk-...";
          models = [{ id = "gpt-4o"; }];
        };
      };
    };

    extensions = [
      "npm:pi-subagents"
    ];
  };
}

As i’m doing it in my free time and i’m quite new to nixos, so feel free to fork it and contribute.

1 Like