tools working

This commit is contained in:
2025-07-17 14:21:19 -06:00
parent 3ed05918bf
commit 11049d9f73
2 changed files with 247 additions and 237 deletions

View File

@@ -6,52 +6,70 @@
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit 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"
];
};
};
};
in { in {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [ bash glib glib.out uv nodejs_22 opencode ];
bash
glib
glib.out
chromium
uv
nodejs_22
opencode
];
}; };
packages.run = pkgs.writeShellScriptBin "run_flake" '' packages.run = pkgs.writeShellScriptBin "run_flake" ''
mkdir -p ~/.config/opencode mkdir -p ~/.config/opencode
cp ${self.packages.${system}.config_json} ~/.config/opencode/opencode.json cp ${
self.packages.${system}.config_json
} ~/.config/opencode/opencode.json
${pkgs.opencode}/bin/opencode ${pkgs.opencode}/bin/opencode
''; '';
packages.config_json = pkgs.writeTextFile { packages.config_json = pkgs.writeTextFile {
name = "config.json"; name = "config.json";
text = '' text = builtins.toJSON opencodeConfig;
{ };
"$schema": "https://opencode.ai/config.json", packages.opencodeInstance = pkgs.stdenv.mkDerivation {
"theme": "github", name = "opencode";
"mcp": { buildInputs = [ pkgs.opencode ];
"memory": { installPhase = ''
"type": "local", mkdir -p $out/bin
"command": [ "npx", "-y", "@modelcontextprotocol/server-memory" ] ln -s ${pkgs.opencode}/bin/opencode $out/bin/opencode
}, mkdir -p $out/config
"playwright": { cp ${self.packages.${system}.config_json} $out/config/opencode.json
"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"]
}
}
}
''; '';
}; };
}); });

View File

@@ -1,7 +1,10 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
nixgl = import (fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz") {}; opencodeFlake = import ../../flakes/opencode;
nixgl = import
(fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz")
{ };
in { in {
home.username = "alexm"; home.username = "alexm";
home.homeDirectory = "/home/alexm"; home.homeDirectory = "/home/alexm";
@@ -14,10 +17,7 @@ in {
kubectl kubectl
lazydocker lazydocker
traceroute traceroute
(with dotnetCorePackages; combinePackages [ (with dotnetCorePackages; combinePackages [ sdk_8_0 sdk_9_0 ])
sdk_8_0
sdk_9_0
])
nodejs_22 nodejs_22
parallel parallel
k0sctl k0sctl
@@ -42,6 +42,7 @@ in {
firefoxpwa firefoxpwa
bluetui bluetui
nixfmt nixfmt
opencodeFlake.packages.${pkgs.system}.opencodeInstance
]; ];
programs.firefox = { programs.firefox = {
@@ -50,12 +51,8 @@ in {
nativeMessagingHosts = [ pkgs.firefoxpwa ]; nativeMessagingHosts = [ pkgs.firefoxpwa ];
}; };
programs.direnv = { programs.direnv = { enable = true; };
enable = true; programs.ghostty = { enable = true; };
};
programs.ghostty = {
enable = true;
};
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = '' shellInit = ''
@@ -167,8 +164,6 @@ end
function plz function plz
ghcs suggest "$argv" ghcs suggest "$argv"
end end
fish_add_path /home/alexm/.opencode/bin
''; '';
}; };
home.file = { home.file = {
@@ -222,7 +217,8 @@ k9s:
namespace: namespace:
lockFavorites: false''; lockFavorites: false'';
".local/share/applications/firefox.desktop".text = ''[Desktop Entry] ".local/share/applications/firefox.desktop".text = ''
[Desktop Entry]
Version=1.0 Version=1.0
Type=Application Type=Application
Name=Firefox Name=Firefox
@@ -244,7 +240,8 @@ Name=Open a New Private Window
Exec=firefox --private-window Exec=firefox --private-window
''; '';
".local/share/applications/teams.desktop".text = ''[Desktop Entry] ".local/share/applications/teams.desktop".text = ''
[Desktop Entry]
Version=1.0 Version=1.0
Type=Application Type=Application
Name=Microsoft Teams (Web) Name=Microsoft Teams (Web)
@@ -256,17 +253,11 @@ Categories=Network;WebBrowser;
''; '';
}; };
home.sessionVariables = { home.sessionVariables = { EDITOR = "vim"; };
EDITOR = "vim";
};
dconf.enable = true; dconf.enable = true;
dconf.settings = { dconf.settings = {
"org/gnome/desktop/wm/keybindings" = { "org/gnome/desktop/wm/keybindings" = { toggle-maximized = [ "<Super>m" ]; };
toggle-maximized=["<Super>m"]; "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; };
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [ custom-keybindings = [
@@ -274,7 +265,8 @@ Categories=Network;WebBrowser;
]; ];
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" =
{
name = "Launch Ghostty"; name = "Launch Ghostty";
command = "nixGL ghostty"; command = "nixGL ghostty";
binding = "<Super>t"; binding = "<Super>t";