diff options
| -rw-r--r-- | configs/hermes.nix | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix index ea50dbd..80eab2f 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -2,14 +2,16 @@ # guest. hermes runs as hermes in a tmux, which root's console opens. It # uses the Claude subscription through the claude CLI: log in once with # claude auth login, in a new window there (C-b c). -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, hostPkgs, ... }: let tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux"; # The provider plugin, installed by hermes-agent-setup, see there. claude-subscription-directsdk = pkgs.runCommand "claude-subscription-directsdk" { } '' - cp -r ${builtins.fetchTarball { - url = "https://github.com/NousResearch/hermes-official-plugins/archive/80025332933bf84fb3c7b68f369d9fe59a771e98.tar.gz"; - sha256 = "1ivgwfqnhgpwsp204ljsm4jwcq00n8zs4pd5dgyx0crb3hdig3bq"; + cp -r ${pkgs.fetchFromGitHub { + owner = "NousResearch"; + repo = "hermes-official-plugins"; + rev = "80025332933bf84fb3c7b68f369d9fe59a771e98"; + hash = "sha256-eI0XGxwrM9D9a6Vdoj+yAGDGJalaUgLE1fw+aLHjb8c="; }}/claude-subscription-directsdk $out ''; @@ -18,10 +20,13 @@ let exec ${tmux} attach -t hermes ''; - # Bump url and sha256 together. - src = builtins.fetchTarball { - url = "https://github.com/NousResearch/hermes-agent/archive/9f47677483d1b4de4d1a88d37b3b7ca18b18b215.tar.gz"; - sha256 = "1xpvwgmn5slmfc2zsr5bfgywz1c6dqx3i5qy6ppbdvg1j2vngx71"; + # Fetched with the host's pkgs (see default.nix), as imports need it. + # Bump rev and hash together. + src = hostPkgs.fetchFromGitHub { + owner = "NousResearch"; + repo = "hermes-agent"; + rev = "9f47677483d1b4de4d1a88d37b3b7ca18b18b215"; + hash = "sha256-4fRnt5Dh7bbuNR6XODpuhoXP/XOrZP0Fc5XqYuvj+/Y="; }; # hermes-agent's flake without flakes, like flake-compat, but with this @@ -36,9 +41,9 @@ let self; input = name: let locked = (builtins.fromJSON (builtins.readFile (src + "/flake.lock"))).nodes.${name}.locked; - in builtins.fetchTarball { - url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz"; - sha256 = locked.narHash; + in hostPkgs.fetchFromGitHub { + inherit (locked) owner repo rev; + hash = locked.narHash; }; nixpkgs = { _type = "flake"; |
