Enable OpenCode and add its configuration

Enable the OpenCode service on both desktop and laptop hosts.
Import the opencode module into the home configuration and provide
settings, plugins, extra packages, and skill definitions for full
functionality.
This commit is contained in:
GarandPLG committed 2026-10-18 19:33:33 +02:00
1 parent 841132185c
commit 86d5cc3d32
13 files changed
+133 -3

No files matched your search

+3
View File
@@ -10,6 +10,9 @@
enable = true;
package = pkgs.codex;
mutableSettings = true;
# skills = {
# beads = "${pkgs.beads.src}/plugins/beads/skills/beads";
# };
};
imports = [
+1 -1
View File
@@ -11,6 +11,7 @@ _: {
./noctalia
# ./noctalia-shell
./obsidian
./opencode
./scripts
./vscodium
./xdg
@@ -35,7 +36,6 @@ _: {
./obs-studio.nix
./ollama.nix
./onlyoffice.nix
./opencode.nix
./prismlauncher.nix
./qt.nix
./skills.nix
@@ -9,5 +9,15 @@
config.programs.opencode = lib.mkIf config.opencode.enable {
enable = true;
package = pkgs.opencode;
validateFiles = {
config = true;
tui = true;
};
};
imports = [
./settings
./skills
./extra-packages.nix
];
}
+12
View File
@@ -0,0 +1,12 @@
{pkgs, ...}: {
programs.opencode.extraPackages = with pkgs; [
uv
ruff
biome
bun
beads
rust-analyzer
alejandra
docker
];
}
@@ -0,0 +1,16 @@
_: {
programs.opencode.settings = {
autoupdate = false;
compaction = {
auto = true;
prune = false;
};
};
imports = [
./formatter.nix
./model.nix
./permission.nix
./plugin.nix
];
}
@@ -0,0 +1,35 @@
_: {
programs.opencode.settings.formatter = {
gofmt.disabled = true;
mix.disabled = true;
prettier.disabled = true;
zig.disabled = true;
clang-format.disabled = true;
ktlint.disabled = true;
rubocop.disabled = true;
standardrb.disabled = true;
htmlbeautifier.disabled = true;
air.disabled = true;
dart.disabled = true;
dfmt.disabled = true;
ocamlformat.disabled = true;
terraform.disabled = true;
gleam.disabled = true;
nixfmt.disabled = true;
shfmt.disabled = true;
pint.disabled = true;
oxfmt.disabled = true;
ormolu.disabled = true;
# biome = {};
# ruff = {};
# rustfmt = {};
# cargo = {};
# uv = {};
alejandra = {
command = ["alejandra" "$FILE"];
extensions = [".nix"];
};
};
}
+7
View File
@@ -0,0 +1,7 @@
_: {
programs.opencode.settings = {
model = "cerebras/gpt-oss-120b";
small_model = "cerebras/qwen-3.8-27b";
enabled_providers = ["cerebras"];
};
}
@@ -0,0 +1,13 @@
_: {
programs.opencode.settings.permission = {
bash = "allow";
edit = "allow";
grep = "allow";
glob = "allow";
lsp = "ask";
skill = "allow";
webfetch = "ask";
websearch = "ask";
question = "allow";
};
}
@@ -0,0 +1,7 @@
_: {
programs.opencode.settings.plugin = [
"@dietrichgebert/ponytail"
"context-mode"
"opencode-mem"
];
}
+5
View File
@@ -0,0 +1,5 @@
_: {
imports = [
./understand-anything.nix
];
}
@@ -0,0 +1,22 @@
{pkgs, ...}: let
understand-anything-src = pkgs.fetchFromGitHub {
name = "understand-anything";
owner = "Egonex-AI";
repo = "Understand-Anything";
tag = "v2.9.0";
sha256 = "sha256-nECfbp0vyFZRZX0Zg2s4ga/kYSCihJxYt9lxUHLGmFA=";
};
understand-anything = "${understand-anything-src}/understand-anything-plugin/skills";
in {
programs.opencode.skills = {
understand = "${understand-anything}/understand";
understand-chat = "${understand-anything}/understand-chat";
understand-dashboard = "${understand-anything}/understand-dashboard";
understand-diff = "${understand-anything}/understand-diff";
understand-domain = "${understand-anything}/understand-domain";
understand-explain = "${understand-anything}/understand-explain";
understand-figma = "${understand-anything}/understand-figma";
understand-knowledge = "${understand-anything}/understand-knowledge";
understand-onboard = "${understand-anything}/understand-onboard";
};
}