opencode flake moving

This commit is contained in:
2025-07-17 15:39:29 -06:00
parent 02fce7a22e
commit 13180ff6cd
3 changed files with 13 additions and 1 deletions

60
nix/flakes/opencode/flake.lock generated Normal file
View File

@@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1752781635,
"narHash": "sha256-eveRosa7OLVqCbAccV5Azu7ICM1s7xPulWsLQU0bnig=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "981f2095b201d5f61e81c6cecc054c3a2a130d0b",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -0,0 +1,75 @@
{
description = "OpenCode MCP dev shell";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
opencodeConfig = {
"$schema" = "https://opencode.ai/config.json";
theme = "github";
provider = {
ollama = {
npm = "@ai-sdk/openai-compatible";
options = {
baseURL = "http://ai-snow.reindeer-pinecone.ts.net:11434/v1";
};
models = {
"llama3.1:70b" = { };
"deepseek-r1:70b" = { };
"mistral:latest" = { };
"qwen3:32b" = { };
};
};
};
mcp = {
playwright = {
type = "local";
command = [
"npx"
"-y"
"@playwright/mcp@latest"
"--executable-path"
"${pkgs.chromium}/bin/chromium"
"--no-sandbox"
];
};
sequential_thinking = {
type = "local";
command = [
"npx"
"-y"
"@modelcontextprotocol/server-sequential-thinking"
];
};
discord_bot = {
type = "local";
command = [
"npx"
"-y"
"@pyroprompts/mcp-stdio-to-streamable-http-adapter"
];
environment = {
URI = "http://server.alexmickelson.guru:5678/mcp/";
MCP_NAME = "discord_bot";
};
};
};
};
configJson = pkgs.writeTextFile {
name = "config.json";
text = builtins.toJSON opencodeConfig;
};
in {
packages = rec {
opencode = pkgs.writeShellScriptBin "opencode" ''
mkdir -p ~/.config/opencode
cp ${configJson} ~/.config/opencode/opencode.json
${pkgs.opencode}/bin/opencode
'';
};
});
}

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
let
opencodeFlake = builtins.getFlake (toString ../../flakes/opencode);
opencodeFlake = builtins.getFlake (toString ../flakes/opencode);
nixgl = import
(fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz")
{ };