convez.ai
MCP ServerDevOps & InfraestruturaAvançado
dryvist

nix-ai — Stack de IA Declarativo

dryvist/nix-ai

Stack de IA declarativo em Nix, portável entre máquinas

Ver no GitHub
InicialPluginScore · de 0 a 100

Toolkit de IA reproduzível declarado em Nix, gerenciando Claude, Gemini, Copilot e 15+ servidores MCP em um único flake. Sincroniza toda sua configuração entre máquinas com um comando, eliminando reconfiguração manual.

Instalação

$npx convez-ai dryvist/nix-ai

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
11
Forks
5
Acompanhando
0
Saúde
50%
Último commit
há 1 dia
Versão
v8.39.1
Issues abertas
15
Contribuidores
5

Casos de uso

  • Sincronizar configuração de múltiplas ferramentas IA entre máquinas de desenvolvimento
  • Gerenciar plugins, permissões e MCP servers como código versionado
  • Executar inferência local em Apple Silicon com MLX via Nix

Veredito

Solução elegante para quem trabalha com Nix e precisa de portabilidade total do stack de IA. Curva de aprendizado steep se você não domina Nix/home-manager, mas oferece reprodutibilidade genuína que ferramentas de configuração UI não alcançam.

README

A tradução para o português deste README ainda está na fila.

nix-ai

CI

Your AI coding toolkit, declared once. Reproduced everywhere

Ever spent hours configuring Claude Code plugins, Gemini settings, and MCP servers -- only to lose it all when you switch machines? nix-ai captures your entire AI setup as code using Nix. One command rebuilds everything, identically, every time.


What it manages

ToolWhat you get
Claude CodePlugin ecosystem, hooks, agents, commands, rules, statusline
Gemini CLISettings, custom commands, permission rules
GitHub CopilotConfiguration, permissions
OpenAI CodexSettings
MCP Servers15+ servers — GitHub, Terraform, Context7, PAL, filesystem, memory, and more
Plugin MarketplaceCurated marketplaces with Nix-pinned flake inputs
AI Dev Toolscclint, doppler-mcp, claude-flow, sync-mlx-models
MLXLocal Apple Silicon inference via vllm-mlx with macOS launchd integration

Prerequisites

  • Nix (Determinate Nix recommended)
  • home-manager
  • Compatible platform: aarch64-darwin or x86_64-linux

Quick start

Add to your Nix flake:

{
  inputs.nix-ai = {
    url = "github:JacobPEvans/nix-ai";
    inputs.nixpkgs.follows = "nixpkgs";
    inputs.home-manager.follows = "home-manager";
  };
}

Then in your home-manager config:

sharedModules = [ nix-ai.homeManagerModules.default ];

That's it. Every AI tool, every plugin, every permission rule — managed by Nix.

How it works

nix-ai exports home-manager modules that merge into your existing configuration:

ExportWhat it includes
homeManagerModules.defaultFull AI stack — Claude, Gemini, Copilot, Codex, MCP, MLX, dev tools
homeManagerModules.claudeJust Claude Code
homeManagerModules.codexJust OpenAI Codex
homeManagerModules.maestroJust Maestro orchestration
lib.ci.claudeSettingsJsonPure JSON for CI validation (no derivations needed)
lib.ci.codexRulesCodex rules export for CI validation and downstream consumers
lib.aiStackModelsRole-name → physical model ID registry builder — a function { defaultLocalModelId } (no module system needed)

Cross-repo consumption — lib.aiStackModels

lib.aiStackModels is a function { defaultLocalModelId } (no home-manager module system required) that maps every stable capability-class name to the supplied physical mlx-community/* model ID. The caller provides defaultLocalModelId (sourced from the AI_MODEL_LOCAL_LLM org variable / Doppler secret — never hardcoded in this repo). Foreign consumers such as the orbstack-kubernetes Bifrost gateway can call it directly so model: "default" resolves prefix-free without duplicating the registry.

inputs.nix-ai.url = "github:JacobPEvans/nix-ai";
# ...
# Build Bifrost alias table from role names to mlx-local/ prefixed physical IDs
aliases = lib.mapAttrs
  (_role: physical: "mlx-local/${physical}")
  (inputs.nix-ai.lib.aiStackModels { defaultLocalModelId = "mlx-community/<provider-tag>-<model-name>-<quant>"; });

The module option services.aiStack.models remains the public API for nix-ai home-manager consumers; lib.aiStackModels is for foreign consumers that do not import the module.

Self-contained design

The module injects its own dependencies via _module.args. Your consuming flake only needs two lines:

inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";

No AI-specific inputs to wire up. No extra configuration. It just works.

Available module options

Key enable toggles exposed by the default module:

OptionTypeDefaultDescription
programs.claude.enablebool—Enable Claude Code configuration
programs.claude.apiKeyHelper.enableboolfalseHeadless API key authentication via Bitwarden
programs.claudeStatusline.enableboolfalseClaude Code powerline statusline
programs.claude.settings.sandbox.enabledboolfalseFilesystem/network sandbox isolation
programs.claude.settings.alwaysThinkingEnabledbooltrueExtended thinking mode
programs.claude.remoteControlAtStartupbool or nullnullRemote Control auto-start
programs.claude.modelstring or nullnullOverride default model (e.g. "opus", "sonnet")
programs.claude.effortLevelenum or nullnullAdaptive reasoning effort ("low", "medium", "high"); null = upstream default (medium for Max/Team as of v2.1.68)
programs.claude.trustedProjectDirslist of str[]Base directories for auto-trust of CLAUDE.md imports

For the full option set, see modules/claude/options.nix.

Testing and validation

Run quality checks locally:

nix flake check

This runs formatting (nixfmt), static analysis (statix), dead code detection (deadnix), shell script linting (shellcheck), and full module evaluation (module-eval) to verify the home-manager module instantiates correctly with real inputs.

Fix formatting automatically:

nix fmt

Repository structure

modules/
├── claude/          # Claude Code module — see [modules/claude/README.md](modules/claude/README.md)
├── maestro/         # Maestro agent orchestration
├── mcp/             # 15+ MCP server definitions
├── common/          # Shared permission engine
├── gh-extensions/   # GitHub CLI extensions (gh-aw)
├── permissions/     # Per-tool permission rules
├── mlx/             # MLX inference server (vllm-mlx)
├── ai-tools.nix     # AI development tool packages
├── gemini.nix       # Gemini CLI configuration
├── copilot.nix      # GitHub Copilot configuration
└── codex.nix        # OpenAI Codex configuration
lib/                  # Key lib files (not full listing)
├── claude-settings.nix    # Pure settings generator
└── claude-registry.nix    # Marketplace format functions

Part of a trio

This repo is one of three that work together:

RepoWhat it does
nix-ai (you are here)AI coding tools
nix-homeDev environment (git, zsh, VS Code, tmux)
nix-darwinmacOS system config (consumes both)

License

MIT

Ver o original no GitHub

Bom para

Relacionados