From b661acc7f1383cb3df062d11c54c1ab8408089a8 Mon Sep 17 00:00:00 2001 From: poslop Date: Sat, 30 May 2026 19:48:59 -0500 Subject: [PATCH] hermes memory --- .gitignore | 0 flake.lock | 120 +++++++++++++++++++++++--- flake.nix | 7 +- modules/core/nvim.nix | 2 + modules/hermes/default.nix | 1 + modules/hermes/hermes.nix | 39 ++++++++- modules/hermes/secrets/agenix.nix | 15 ++++ modules/hermes/secrets/default.nix | 5 ++ modules/hermes/secrets/hermes-env.age | Bin 0 -> 367 bytes modules/hermes/secrets/secrets.nix | 6 ++ 10 files changed, 177 insertions(+), 18 deletions(-) create mode 100644 .gitignore create mode 100644 modules/hermes/secrets/agenix.nix create mode 100644 modules/hermes/secrets/default.nix create mode 100644 modules/hermes/secrets/hermes-env.age create mode 100644 modules/hermes/secrets/secrets.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock index 09ad853..8c9ef1e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1770165109, + "narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", + "owner": "ryantm", + "repo": "agenix", + "rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "aquamarine": { "inputs": { "hyprutils": [ @@ -33,6 +54,28 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -95,7 +138,7 @@ "hermes-agent": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "npm-lockfile-fix": "npm-lockfile-fix", "pyproject-build-systems": "pyproject-build-systems", "pyproject-nix": "pyproject-nix_2", @@ -163,6 +206,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "zen-browser", @@ -252,9 +316,9 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "hyprwire": "hyprwire", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_2", + "systems": "systems_3", "xdph": "xdph" }, "locked": { @@ -504,7 +568,7 @@ }, "ndg": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1766342086, @@ -543,6 +607,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1754028485, + "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "59e69648d345d6e8fef86158c555730fa12af9de", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1775036866, "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", @@ -558,7 +638,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1766070988, "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", @@ -574,7 +654,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1767379071, "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", @@ -590,7 +670,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1769170682, "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", @@ -606,7 +686,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1768127708, "narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=", @@ -756,11 +836,12 @@ }, "root": { "inputs": { + "agenix": "agenix", "hermes-agent": "hermes-agent", "hjem": "hjem", "hjem-rum": "hjem-rum", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "zen-browser": "zen-browser" } }, @@ -793,7 +874,7 @@ "nixpkgs" ], "rust-overlay": "rust-overlay", - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1763430012, @@ -825,6 +906,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=", @@ -952,8 +1048,8 @@ }, "zen-browser": { "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_5" + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1769491693, diff --git a/flake.nix b/flake.nix index 35cca8b..cd009ad 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ hyprland.url = "github:hyprwm/Hyprland"; hermes-agent.url = "github:NousResearch/hermes-agent"; + agenix.url = "github:ryantm/agenix"; hjem = { url = "github:feel-co/hjem"; @@ -26,7 +27,6 @@ { self, nixpkgs, - hermes-agent, ... }@inputs: let @@ -51,10 +51,7 @@ nixos-vm2 = mkHost "nixos-vm2" [ ./hosts/nixos-vm2/configuration.nix ]; qemu-vm = mkHost "qemu-vm" [ ./hosts/qemu-vm/configuration.nix ]; goyplex-vm = mkHost "goyplex-vm" [ ./hosts/goyplex-vm/configuration.nix ]; - hermes-vm = mkHost "hermes-vm" [ - hermes-agent.nixosModules.default - ./hosts/hermes-vm/configuration.nix - ]; + hermes-vm = mkHost "hermes-vm" [ ./hosts/hermes-vm/configuration.nix ]; }; }; } diff --git a/modules/core/nvim.nix b/modules/core/nvim.nix index 43215aa..e6a07f9 100644 --- a/modules/core/nvim.nix +++ b/modules/core/nvim.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { + environment.variables.EDITOR = "nvim"; + systemd.user.services."nvim-config" = { description = "Clone Neovim config into ~/.config/nvim"; after = [ "network.target" ]; diff --git a/modules/hermes/default.nix b/modules/hermes/default.nix index f9dc820..b68e8b4 100644 --- a/modules/hermes/default.nix +++ b/modules/hermes/default.nix @@ -2,5 +2,6 @@ imports = [ ./sudo.nix ./hermes.nix + ./secrets ]; } diff --git a/modules/hermes/hermes.nix b/modules/hermes/hermes.nix index 0517db2..076b429 100644 --- a/modules/hermes/hermes.nix +++ b/modules/hermes/hermes.nix @@ -1,12 +1,49 @@ +{ inputs, config, ... }: + { + imports = [ inputs.hermes-agent.nixosModules.default ]; + services.hermes-agent = { enable = true; addToSystemPackages = true; + extraDependencyGroups = [ + "messaging" + "bedrock" + ]; + environmentFiles = [ + config.age.secrets.hermes-env.path + ]; container = { + image = "debian:bookworm"; + backend = "docker"; enable = true; hostUsers = [ "poslop" ]; }; - settings.model.base_url = "http://10.0.1.139:5000/v1"; + settings = { + model = { + default = "Qwen3.6-35B-A3B-Uncensored-HauhauCS-Aggressive-Q4_K_P.gguf"; + provider = "local"; + }; + + memory = { + memory_enabled = true; + user_profile_enabled = true; + }; + + model_aliases = { + bedrock = { + model = "us.anthropic.claude-sonnet-4-6"; + provider = "bedrock"; + }; + }; + + custom_providers = [ + { + name = "local"; + base_url = "http://10.0.1.139:5000/v1"; + } + ]; + }; }; } diff --git a/modules/hermes/secrets/agenix.nix b/modules/hermes/secrets/agenix.nix new file mode 100644 index 0000000..182b916 --- /dev/null +++ b/modules/hermes/secrets/agenix.nix @@ -0,0 +1,15 @@ +{ + inputs, + pkgs, + username, + ... +}: + +{ + imports = [ inputs.agenix.nixosModules.default ]; + age.secrets."hermes-env".file = ./hermes-env.age; + + hjem.users.${username}.packages = with pkgs; [ + inputs.agenix.packages."${system}".default + ]; +} diff --git a/modules/hermes/secrets/default.nix b/modules/hermes/secrets/default.nix new file mode 100644 index 0000000..6d00db9 --- /dev/null +++ b/modules/hermes/secrets/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./agenix.nix + ]; +} diff --git a/modules/hermes/secrets/hermes-env.age b/modules/hermes/secrets/hermes-env.age new file mode 100644 index 0000000000000000000000000000000000000000..1e0660bfe87684e0971b7912f2d352119039979b GIT binary patch literal 367 zcmV-#0g(P-XJsvAZewzJaCB*JZZ2