diff --git a/flake.lock b/flake.lock index 5eb3f59..bf30ce1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,65 @@ { "nodes": { + "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_2", + "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" + } + }, "disko": { "inputs": { "nixpkgs": "nixpkgs" @@ -35,6 +95,27 @@ } }, "flake-parts": { + "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_2": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, @@ -85,10 +166,48 @@ "type": "github" } }, + "import-tree_2": { + "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" + } + }, + "llm-agents": { + "inputs": { + "blueprint": "blueprint", + "bun2nix": "bun2nix", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_3", + "systems": "systems", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1776761469, + "narHash": "sha256-BatEItZry4ZzjLPYhak+G7sydpYaPxMRXLgmJ0s3+Vc=", + "owner": "numtide", + "repo": "llm-agents.nix", + "rev": "fe8991eb26b03e7559807c260d978cc0a987fa9e", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "llm-agents.nix", + "type": "github" + } + }, "lux-pkgs": { "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_3" + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1772315038, @@ -108,7 +227,7 @@ "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -162,7 +281,7 @@ }, "nix-wrapper-modules": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1776740142, @@ -241,6 +360,22 @@ "type": "github" } }, + "nixpkgs_10": { + "locked": { + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1775423009, @@ -258,6 +393,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1776329215, + "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b86751bc4085f48661017fa226dee99fab6c651b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1772173633, "narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=", @@ -273,7 +424,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1776548001, "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", @@ -289,7 +440,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1775579569, "narHash": "sha256-/m3yyS/EnXqoPGBJYVy4jTOsirdgsEZ3JdN2gGkBr14=", @@ -305,7 +456,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1776329215, "narHash": "sha256-mBqzkn7oJti2hqeO8iTbDxKw+1ifxpP53feQ0CEXies=", @@ -318,7 +469,7 @@ "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1776548001, "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", @@ -334,7 +485,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1775888245, "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", @@ -350,25 +501,9 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1768564909, - "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "noctalia": { "inputs": { - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "noctalia-qs": "noctalia-qs" }, "locked": { @@ -391,8 +526,8 @@ "noctalia", "nixpkgs" ], - "systems": "systems", - "treefmt-nix": "treefmt-nix" + "systems": "systems_2", + "treefmt-nix": "treefmt-nix_2" }, "locked": { "lastModified": 1776585574, @@ -417,11 +552,12 @@ ], "home-manager": "home-manager", "import-tree": "import-tree", + "llm-agents": "llm-agents", "lux-pkgs": "lux-pkgs", "niri": "niri", "nix-wrapper-modules": "nix-wrapper-modules", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "noctalia": "noctalia", "sops-nix": "sops-nix", "vicinae-extensions": "vicinae-extensions" @@ -429,7 +565,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1776771786, @@ -446,6 +582,21 @@ } }, "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -460,7 +611,7 @@ "type": "github" } }, - "systems_2": { + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -476,6 +627,27 @@ } }, "treefmt-nix": { + "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" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "noctalia", @@ -525,8 +697,8 @@ "vicinae-extensions": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs_9", - "systems": "systems_2", + "nixpkgs": "nixpkgs_10", + "systems": "systems_3", "vicinae": "vicinae" }, "locked": { diff --git a/flake.nix b/flake.nix index 9634c66..0b42bec 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ flake-parts.follows = "lux-pkgs/flake-parts"; home-manager.url = "github:nix-community/home-manager"; import-tree.url = "github:vic/import-tree"; + llm-agents.url = "github:numtide/llm-agents.nix"; niri.url = "github:sodiboo/niri-flake"; nix-wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; diff --git a/modules/features/ai.nix b/modules/features/ai.nix new file mode 100644 index 0000000..a9f73c4 --- /dev/null +++ b/modules/features/ai.nix @@ -0,0 +1,64 @@ +{ inputs, ... }: +let + sharedContext = '' + # AI Global Context + + This shared Codex and Gemini context is intentionally minimal for now. + + TODO: add persistent global AI instructions. + ''; +in +{ + flake.modules.nixos.ai = { + nixpkgs.overlays = [ inputs.llm-agents.overlays.default ]; + + nix.settings = { + extra-substituters = [ "https://cache.numtide.com" ]; + extra-trusted-public-keys = [ + "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" + ]; + }; + }; + + flake.modules.homeManager.ai = + { config, pkgs, ... }: + { + home.sessionVariables.GEMINI_CONFIG_DIR = "${config.xdg.configHome}/gemini"; + + programs.gemini-cli = { + enable = true; + package = pkgs.llm-agents.gemini-cli; + context.AGENTS = sharedContext; + settings = { + context = { + fileName = [ + "AGENTS.md" + "GEMINI.md" + ]; + loadMemoryFromIncludeDirectories = true; + }; + model.name = "gemini-3.1-pro-preview"; + }; + }; + + programs.codex = { + enable = true; + package = pkgs.llm-agents.codex; + context = sharedContext; + settings = { + model = "gpt-5.4"; + model_reasoning_effort = "high"; + plan_mode_reasoning_effort = "high"; + tui.status_line = [ + "model-with-reasoning" + "current-dir" + "git-branch" + "context-remaining" + "five-hour-limit" + ]; + personality = "pragmatic"; + features.undo = true; + }; + }; + }; +} diff --git a/modules/features/cli-base.nix b/modules/features/cli-base.nix index 94572d3..e9ecffc 100644 --- a/modules/features/cli-base.nix +++ b/modules/features/cli-base.nix @@ -11,7 +11,7 @@ in homeModules.git homeModules.dev-tools homeModules.podman - homeModules.gemini + homeModules.ai ]; }; } diff --git a/modules/features/gemini.nix b/modules/features/gemini.nix deleted file mode 100644 index a365d2d..0000000 --- a/modules/features/gemini.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - flake.modules.homeManager.gemini = - { config, ... }: - { - home.sessionVariables.GEMINI_CONFIG_DIR = "${config.xdg.configHome}/gemini"; - - programs.gemini-cli.enable = true; - programs.opencode.enable = true; - programs.npm.enable = true; - }; -} diff --git a/modules/features/host-base.nix b/modules/features/host-base.nix index 39df47f..8a8f5ef 100644 --- a/modules/features/host-base.nix +++ b/modules/features/host-base.nix @@ -12,6 +12,7 @@ in imports = [ nixosModules.meta inputs.home-manager.nixosModules.home-manager + nixosModules.ai nixosModules.nix nixosModules.region-nl ];