rest of the split migration
This commit is contained in:
18
modules/dev/mcp/common.nix
Normal file
18
modules/dev/mcp/common.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ pkgs, inputs }:
|
||||
let
|
||||
packages = [
|
||||
pkgs.codex
|
||||
inputs.self.packages.${pkgs.system}.nixos-mcp
|
||||
];
|
||||
in
|
||||
{
|
||||
inherit packages;
|
||||
devShell = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "mcp-dev-shell";
|
||||
shellHook = ''
|
||||
export CODEX_HOME=$PWD/.codex
|
||||
echo "MCP shell ready: codex + nixos-mcp"
|
||||
'';
|
||||
};
|
||||
}
|
||||
34
modules/dev/mcp/home.nix
Normal file
34
modules/dev/mcp/home.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hm = inputs.self.lib.hmModule {
|
||||
inherit
|
||||
config
|
||||
inputs
|
||||
osConfig
|
||||
;
|
||||
optionPath = [
|
||||
"dev"
|
||||
"mcp"
|
||||
];
|
||||
};
|
||||
cfg = config.my.dev.mcp;
|
||||
feature = import ./common.nix { inherit pkgs inputs; };
|
||||
in
|
||||
{
|
||||
options.my.dev.mcp.enable = lib.mkEnableOption "Install MCP tooling globally";
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.dev.mcp.enable = lib.mkDefault hm.enabledByDefault;
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = feature.packages;
|
||||
})
|
||||
];
|
||||
}
|
||||
27
modules/dev/mcp/nixos.nix
Normal file
27
modules/dev/mcp/nixos.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = import ./common.nix { inherit pkgs inputs; };
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.dev.mcp = {
|
||||
enable = lib.mkEnableOption "Install MCP tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install MCP packages for";
|
||||
};
|
||||
};
|
||||
devShells.mcp = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = feature.devShell;
|
||||
description = "MCP dev shell for this repo";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user