mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
chore: add MCP to vscode
This commit is contained in:
parent
bf82970b9e
commit
22fa3ed73a
1 changed files with 27 additions and 0 deletions
|
|
@ -17,6 +17,30 @@
|
|||
};
|
||||
};
|
||||
|
||||
mkMcpStdio = {name, command, env ? {}}: let
|
||||
# If any of the envs values starts with ${input:...}, then we should create a new password input
|
||||
envValues = lib.attrValues env;
|
||||
inputEnvs = lib.filter (value: lib.hasPrefix "\${input:" value) envValues;
|
||||
# Get the ids of the inputs
|
||||
inputEnvsIds = lib.map (value: lib.substring 8 (lib.stringLength value - 9) value) inputEnvs;
|
||||
in {
|
||||
mcp = {
|
||||
inputs = lib.map (value: {
|
||||
"type" = "promptString";
|
||||
"id" = value; # Assigning the name as the id
|
||||
"description" = "Enter the password for ${value}";
|
||||
"password" = true;
|
||||
}) inputEnvsIds;
|
||||
servers."${name}" = {
|
||||
"type" = "stdio";
|
||||
"command" = builtins.elemAt command 0;
|
||||
"args" = builtins.tail command;
|
||||
"env" = env;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# I can't get nix-vscode-extensions to respect allowUnfree, so this is a workaround
|
||||
allowUnfree = ext: ext.override {meta.license = [];};
|
||||
in {
|
||||
|
|
@ -45,6 +69,7 @@ in {
|
|||
"**/*.egg-info" = true;
|
||||
"**/__pycache__" = true;
|
||||
};
|
||||
"workbench.editor.wrapTabs" = true;
|
||||
|
||||
# Files
|
||||
"files.autoSave" = "afterDelay";
|
||||
|
|
@ -83,6 +108,8 @@ in {
|
|||
}
|
||||
(mkFormatter "esbenp.prettier-vscode" ["json" "jsonc" "markdown" "css" "scss" "typescript" "typescriptreact" "html" "yaml"])
|
||||
(mkFormatter "charliermarsh.ruff" ["python"])
|
||||
(mkMcpStdio {name = "linear"; command = ["npx" "mcp-remote" "https://mcp.linear.app/sse"];})
|
||||
(mkMcpStdio {name = "sentry"; command = ["npx" "mcp-remote" "https://mcp.sentry.dev/sse"];})
|
||||
];
|
||||
extensions = with vscodePkgs; [
|
||||
# Remote
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue