diff --git a/flake.lock b/flake.lock index 37c9817..391359c 100644 --- a/flake.lock +++ b/flake.lock @@ -176,6 +176,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "hermes", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixvimunstable", @@ -196,7 +217,7 @@ "type": "github" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "nurpkgs", @@ -235,6 +256,31 @@ "type": "github" } }, + "hermes": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixunstable" + ], + "npm-lockfile-fix": "npm-lockfile-fix", + "pyproject-build-systems": "pyproject-build-systems", + "pyproject-nix": "pyproject-nix", + "uv2nix": "uv2nix" + }, + "locked": { + "lastModified": 1784663791, + "narHash": "sha256-bPip7Rk/5n5idLvedBXWjzuRw6cc30XGxCRJewlwwUE=", + "owner": "nousresearch", + "repo": "hermes-agent", + "rev": "e2e8823f1d2de2aa95c8147d0abd105539d5daff", + "type": "github" + }, + "original": { + "owner": "nousresearch", + "repo": "hermes-agent", + "type": "github" + } + }, "hmunstable": { "inputs": { "nixpkgs": [ @@ -512,7 +558,7 @@ }, "nixvimunstable": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "nixpkgs": "nixpkgs_5", "systems": "systems_4" }, @@ -531,9 +577,30 @@ "type": "github" } }, + "npm-lockfile-fix": { + "inputs": { + "nixpkgs": [ + "hermes", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775903712, + "narHash": "sha256-2GV79U6iVH4gKAPWYrxUReB0S41ty/Y3dBLquU8AlaA=", + "owner": "jeslie0", + "repo": "npm-lockfile-fix", + "rev": "c6093acb0c0548e0f9b8b3d82918823721930fe8", + "type": "github" + }, + "original": { + "owner": "jeslie0", + "repo": "npm-lockfile-fix", + "type": "github" + } + }, "nurpkgs": { "inputs": { - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "nixpkgs": "nixpkgs_6" }, "locked": { @@ -550,6 +617,56 @@ "type": "github" } }, + "pyproject-build-systems": { + "inputs": { + "nixpkgs": [ + "hermes", + "nixpkgs" + ], + "pyproject-nix": [ + "hermes", + "pyproject-nix" + ], + "uv2nix": [ + "hermes", + "uv2nix" + ] + }, + "locked": { + "lastModified": 1772555609, + "narHash": "sha256-3BA3HnUvJSbHJAlJj6XSy0Jmu7RyP2gyB/0fL7XuEDo=", + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "rev": "c37f66a953535c394244888598947679af231863", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "type": "github" + } + }, + "pyproject-nix": { + "inputs": { + "nixpkgs": [ + "hermes", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772865871, + "narHash": "sha256-/ZTSg97aouL0SlPHaokA4r3iuH9QzHVuWPACD2CUCFY=", + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "rev": "e537db02e72d553cea470976b9733581bcf5b3ed", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -557,6 +674,7 @@ "colmena": "colmena", "darwin": "darwin_2", "flake-parts": "flake-parts", + "hermes": "hermes", "hmunstable": "hmunstable", "minecraft": "minecraft", "niks3": "niks3", @@ -688,6 +806,31 @@ "type": "github" } }, + "uv2nix": { + "inputs": { + "nixpkgs": [ + "hermes", + "nixpkgs" + ], + "pyproject-nix": [ + "hermes", + "pyproject-nix" + ] + }, + "locked": { + "lastModified": 1773039484, + "narHash": "sha256-+boo33KYkJDw9KItpeEXXv8+65f7hHv/earxpcyzQ0I=", + "owner": "pyproject-nix", + "repo": "uv2nix", + "rev": "b68be7cfeacbed9a3fa38a2b5adc0cfb81d9bb1f", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "uv2nix", + "type": "github" + } + }, "vsext": { "inputs": { "nixpkgs": "nixpkgs_7" diff --git a/flake.nix b/flake.nix index d8c1073..2fc238d 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,10 @@ inputs.nixpkgs.follows = "nixunstable"; }; flake-parts.url = "github:hercules-ci/flake-parts"; + hermes = { + url = "github:nousresearch/hermes-agent"; + inputs.nixpkgs.follows = "nixunstable"; + }; hmunstable = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixunstable"; diff --git a/home/hosts/hermes/default.nix b/home/hosts/hermes/default.nix new file mode 100644 index 0000000..6462967 --- /dev/null +++ b/home/hosts/hermes/default.nix @@ -0,0 +1 @@ +{...}: {} diff --git a/hosts/unstable/hermes/default.nix b/hosts/unstable/hermes/default.nix new file mode 100644 index 0000000..a9e052c --- /dev/null +++ b/hosts/unstable/hermes/default.nix @@ -0,0 +1,117 @@ +{ + modulesPath, + top, + ... +}: +{ + imports = [ + (modulesPath + "/virtualisation/proxmox-lxc.nix") + top.hermes.nixosModules.default + ]; + greg = { + home = true; + tailscale.enable = true; + }; + nix.settings = { + sandbox = false; + }; + proxmoxLXC = { + manageNetwork = false; + privileged = true; + }; + services = { + fstrim.enable = false; + hermes-agent = { + enable = true; + settings = { + agent = { + reasoning_effort = "medium"; + reasoning_overrides = { + claude-fable = "xhigh"; + claude-opus = "high"; + }; + tool_loop_guardrails = { + hard_stop_enabled = true; + warnings_enabled = true; + }; + tool_use_enforcement = "auto"; + }; + code_execution = { + mode = "strict"; + timeout = 300; + }; + compression = { + enabled = true; + protect_first_n = 3; + protect_last_n = 5; + target_ratio = 0.25; + threshold = 0.75; + }; + context_file_max_chars = 25000; + file_read_max_chars = 100000; + goals = { + max_turns = 20; # Number of times Hermes tells the model to keep working towards the goal + }; + memory = { + memory_enabled = true; + user_profile_enabled = true; + write_approval = true; + }; + quick_commands = { + disk = { + type = "exec"; + command = "df -h"; + }; + free = { + type = "exec"; + command = "free -h"; + }; + restart = { + type = "alias"; + target = "/gateway restart"; + }; + }; + skills = { + guard_agent_created = true; + write_approval = true; + }; + stt = { + enabled = true; + echo_transcripts = true; + provider = "local"; + local.model = "medium"; + }; + terminal = { + backend = "local"; + }; + tool_output = { + max_bytes = 50000; + max_lines = 2000; + max_line_length = 2000; + }; + worktree = true; # Enable multiple agents in the same repo + }; + }; + openssh = { + enable = true; + openFirewall = true; + settings = { + PermitRootLogin = "yes"; + PasswordAuthentication = true; + PermitEmptyPasswords = "yes"; + }; + }; + wyoming.faster-whisper.servers.medium = { + enable = true; + device = "cpu"; + initialPrompt = '' + The user's name is 'Greg Hellings'. The street he lives on is 'Kardinal Court' + in 'Midlothian'. Keep these in mind as they are often misspelled. + ''; + language = "en"; + model = "medium"; + uri = "tcp://127.0.0.1:10300"; + sttLibrary = "faster-whisper"; + }; + }; +}