Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions modules/home/copilot-cli/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
config,
lib,
pkgs,
...
}:

let
cfg = config.modules.home.copilot-cli;
jsonFormat = pkgs.formats.json { };
in
{
options = {
modules.home.copilot-cli = {
enable = lib.mkEnableOption "copilot-cli" // {
description = "Enable Copilot CLI";
default = false;
};
package = lib.mkOption {
type = lib.types.nullOr lib.types.package;
default = pkgs.github-copilot-cli;
description = "Package to use (null to skip installing)";
};

configDir = lib.mkOption {
type = lib.types.str;
default = "${config.home.homeDirectory}/.copilot";
description = "Directory holding configuration files";
};

enableMcpIntegration = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to integrate MCP servers from programs.mcp.servers";
};

settings = lib.mkOption {
inherit (jsonFormat) type;
default = { };
description = "JSON configuration written to config.json";
};

context = lib.mkOption {
type = lib.types.either lib.types.lines lib.types.path;
default = "";
description = ''
Global instructions, written to copilot-instructions.md.
Either inline content as a string or a path to a file.
'';
};

mcpServers = lib.mkOption {
type = lib.types.attrsOf jsonFormat.type;
default = { };
description = "MCP (Model Context Protocol) servers configuration";
};

lspServers = lib.mkOption {
type = lib.types.attrsOf jsonFormat.type;
default = { };
description = "LSP (Language Server Protocol) servers configuration";
};

agents = lib.mkOption {
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
default = { };
description = "Custom agents (attrset or path to directory)";
};

skills = lib.mkOption {
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
default = { };
description = "Custom skills (attrset or path to directory)";
};
};
};

config = lib.mkIf cfg.enable {
programs.github-copilot-cli = {
enable = true;
inherit (cfg)
package
configDir
enableMcpIntegration
settings
context
mcpServers
lspServers
agents
skills
;
};
};
}
1 change: 1 addition & 0 deletions modules/home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
./awscli
./bash
./claude-code
./copilot-cli
./delta
./direnv
./distrobox
Expand Down