How to consume nix-claude-code from your own flake.
See templates/minimal/ for a working starter. The shape:
{
inputs.nix-claude-code = {
url = "github:dryvist/nix-claude-code";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
outputs = { home-manager, nix-claude-code, ... }: {
homeConfigurations.you = home-manager.lib.homeManagerConfiguration {
modules = [ nix-claude-code.homeModules.default ./home.nix ];
# ...
};
};
}See templates/flake-parts/. Use the flakeModule export
to plug into a flake-parts assembly:
imports = [ inputs.nix-claude-code.flakeModule ];If you only want some subset:
modules = [
nix-claude-code.homeModules.core # settings.json + permissions + binary
nix-claude-code.homeModules.plugins # marketplaces + plugin management
# skip statusline, hooks, mcp, latest
];nix-claude-code only surfaces the option — you populate it from your own runtime:
{
programs.claude.mcpServers = {
my-server = {
command = "${pkgs.my-mcp-server}/bin/my-mcp-server";
args = [];
env = {};
};
};
}If you use JacobPEvans/nix-ai, the integration is
already wired: programs.claude.mcpServers = config.programs.aiMcp.servers.
For AI tools that aren't Claude Code (Codex, Gemini, agent-skills), import only the lib:
{ inputs, ... }:
let
perms = inputs.nix-claude-code.lib.mkDefaultPermissions { tool = "codex"; };
in {
# apply perms.allow / perms.deny / perms.webfetchDomains
}Use follows to align with your own pins:
inputs.nix-claude-code = {
url = "github:dryvist/nix-claude-code";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.claude-plugins-official.follows = "claude-plugins-official";
# ...etc. for any marketplace you pin in your own flake
};