From 3a47cc56b75cf99bdbebb5484a0c7994f5b8a79a Mon Sep 17 00:00:00 2001 From: imxyy_soope_ Date: Sun, 19 Apr 2026 11:01:20 +0800 Subject: [PATCH] use llm-agents.nix --- flake.lock | 166 +++++++++++++++++++++++++++++++- flake.nix | 4 + flake/pkgs.nix | 1 + hosts/imxyy-nix-server/home.nix | 7 -- hosts/imxyy-nix-x16/home.nix | 10 -- hosts/imxyy-nix/home.nix | 10 -- modules/coding/agents.nix | 34 +++++++ modules/coding/all.nix | 1 + 8 files changed, 202 insertions(+), 31 deletions(-) create mode 100644 modules/coding/agents.nix diff --git a/flake.lock b/flake.lock index b0213d6..6b5f782 100644 --- a/flake.lock +++ b/flake.lock @@ -92,6 +92,66 @@ "type": "github" } }, + "blueprint": { + "inputs": { + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ], + "systems": [ + "llm-agents", + "systems" + ] + }, + "locked": { + "lastModified": 1776249299, + "narHash": "sha256-Dt9t1TGRmJFc0xVYhttNBD6QsAgHOHCArqGa0AyjrJY=", + "owner": "numtide", + "repo": "blueprint", + "rev": "56131e8628f173d24a27f6d27c0215eff57e40dd", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "blueprint", + "type": "github" + } + }, + "bun2nix": { + "inputs": { + "flake-parts": [ + "llm-agents", + "flake-parts" + ], + "import-tree": "import-tree", + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ], + "systems": [ + "llm-agents", + "systems" + ], + "treefmt-nix": [ + "llm-agents", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1776182890, + "narHash": "sha256-+/VOe8XGq5klpU+I19D+3TcaR7o+Cwbq67KNF7mcFak=", + "owner": "Mic92", + "repo": "bun2nix", + "rev": "648d293c51e981aec9cb07ba4268bc19e7a8c575", + "type": "github" + }, + "original": { + "owner": "Mic92", + "ref": "catalog-support", + "repo": "bun2nix", + "type": "github" + } + }, "cachix": { "inputs": { "devenv": [ @@ -352,6 +412,27 @@ } }, "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "llm-agents", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_6": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -617,6 +698,21 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1763762820, + "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=", + "owner": "vic", + "repo": "import-tree", + "rev": "3c23749d8013ec6daa1d7255057590e9ca726646", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "infuse": { "flake": false, "locked": { @@ -649,6 +745,31 @@ "type": "github" } }, + "llm-agents": { + "inputs": { + "blueprint": "blueprint", + "bun2nix": "bun2nix", + "flake-parts": "flake-parts_5", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1776523700, + "narHash": "sha256-68F6nNwHcuweEv5XWefCGvBujN4n+oCbuq1ZG+S7pCk=", + "owner": "numtide", + "repo": "llm-agents.nix", + "rev": "e69fff4e65dbdf4a87ee4bdeaa4ea0fe156ae8f5", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "llm-agents.nix", + "type": "github" + } + }, "mission-control": { "locked": { "lastModified": 1733438716, @@ -1035,7 +1156,7 @@ "noctalia", "nixpkgs" ], - "systems": "systems_2", + "systems": "systems_3", "treefmt-nix": [] }, "locked": { @@ -1106,6 +1227,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "infuse": "infuse", + "llm-agents": "llm-agents", "my-templates": "my-templates", "niri": "niri", "nixos-wsl": "nixos-wsl", @@ -1169,13 +1291,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_6", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems_3", + "systems": "systems_4", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", "tinted-tmux": "tinted-tmux", @@ -1231,6 +1353,21 @@ } }, "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1245,7 +1382,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1365,6 +1502,27 @@ "type": "github" } }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 67fad3e..895bcc5 100644 --- a/flake.nix +++ b/flake.nix @@ -79,6 +79,10 @@ url = "github:imxyy1soope1/go-musicfox"; inputs.nixpkgs.follows = "nixpkgs"; }; + llm-agents = { + url = "github:numtide/llm-agents.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; niri.url = "github:sodiboo/niri-flake"; noctalia = { url = "github:noctalia-dev/noctalia-shell/v4.7.5"; diff --git a/flake/pkgs.nix b/flake/pkgs.nix index ad6c657..04b2577 100644 --- a/flake/pkgs.nix +++ b/flake/pkgs.nix @@ -19,6 +19,7 @@ noctalia-shell = inputs.noctalia.packages.${final.stdenv.hostPlatform.system}.default; }) + inputs.llm-agents.overlays.shared-nixpkgs ]; config.allowUnfree = true; flake.setNixPath = false; diff --git a/hosts/imxyy-nix-server/home.nix b/hosts/imxyy-nix-server/home.nix index b01eae9..5a741df 100644 --- a/hosts/imxyy-nix-server/home.nix +++ b/hosts/imxyy-nix-server/home.nix @@ -19,13 +19,6 @@ ".cache" ".ollama" - ".claude" - - ".config/opencode" - ".local/share/opencode" - ]; - homeFiles = [ - ".claude.json" ]; }; }; diff --git a/hosts/imxyy-nix-x16/home.nix b/hosts/imxyy-nix-x16/home.nix index ba5f3eb..9dba200 100644 --- a/hosts/imxyy-nix-x16/home.nix +++ b/hosts/imxyy-nix-x16/home.nix @@ -131,16 +131,6 @@ ".config/dconf" ".config/pip" ".config/sunshine" - - ".gemini" - ".claude" - ".claude-code-router" - - ".config/opencode" - ".local/share/opencode" - ]; - homeFiles = [ - ".claude.json" ]; }; }; diff --git a/hosts/imxyy-nix/home.nix b/hosts/imxyy-nix/home.nix index 9fa1314..a619819 100644 --- a/hosts/imxyy-nix/home.nix +++ b/hosts/imxyy-nix/home.nix @@ -161,16 +161,6 @@ ".config/dconf" ".config/pip" ".config/sunshine" - - ".gemini" - ".claude" - ".claude-code-router" - - ".config/opencode" - ".local/share/opencode" - ]; - homeFiles = [ - ".claude.json" ]; }; }; diff --git a/modules/coding/agents.nix b/modules/coding/agents.nix new file mode 100644 index 0000000..33d8310 --- /dev/null +++ b/modules/coding/agents.nix @@ -0,0 +1,34 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.my.coding.agents; +in +{ + options.my.coding.agents = { + enable = lib.mkEnableOption "LLM coding agents"; + }; + + config = lib.mkIf cfg.enable { + my.hm = { + home.packages = with pkgs.llm-agents; [ + claude-code + opencode + ]; + }; + my.persist = { + homeDirs = [ + ".claude" + + ".config/opencode" + ".local/share/opencode" + ]; + homeFiles = [ + ".claude.json" + ]; + }; + }; +} diff --git a/modules/coding/all.nix b/modules/coding/all.nix index c6faa80..64af801 100644 --- a/modules/coding/all.nix +++ b/modules/coding/all.nix @@ -11,6 +11,7 @@ in my.coding = { editor.all.enable = true; langs.all.enable = true; + agents.enable = true; misc.enable = true; }; };