Files
hermes-guest/flake.nix
T
dckc cfffe56cce feat: the Inference Cooperative as the example upstream, and a live demo
- services.hermes-guest.reasoningEffort (and mkDarwin's): DeepSeek V4.1
  takes only low, high, xhigh or max, and rejects Hermes's default.
- The README's examples use gateway.inference.coop and
  deepseek-flash-tee, its TEE-hosted DeepSeek, which supports tool
  calling.
- demo.py takes an optional MODEL and PROXY command: each connection to
  Hermes's model port is handed to PROXY as its stdin, as launchd and
  systemd hand them to llm-proxy.py, and only the outcome is checked.

Generated-by: Claude Opus 5.5
2026-11-29 16:58:56 -06:00

103 lines
2.8 KiB
Nix

{
description = "Hermes, confined to act only as one toybox guest: a systemd unit on Linux, the same unit in a microVM on macOS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
microvm = {
url = "github:microvm-nix/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# its own nixpkgs: its fixed-output hashes (pnpm deps) are for its pnpm
hermes-agent.url = "github:NousResearch/hermes-agent";
};
outputs =
{
self,
nixpkgs,
microvm,
hermes-agent,
}:
let
inherit (nixpkgs) lib;
in
{
nixosModules = {
# the unit that ports; whoever imports it serves its two sockets
hermes-guest = {
imports = [
hermes-agent.nixosModules.default
./nix/hermes-guest.nix
];
};
# a Linux host: the unit, and the inference proxy, under the host's systemd
linux-host = {
imports = [
self.nixosModules.hermes-guest
./nix/linux-host.nix
];
};
# the macOS VM's NixOS: the unit, with its sockets relayed over vsock
vfkit-vm = {
imports = [
microvm.nixosModules.microvm
self.nixosModules.hermes-guest
./nix/vfkit-vm.nix
];
};
};
lib = {
/**
The macOS VM and its launchd agents, for one person's settings.
hostDir: where the VM's state image and host sockets live.
The toybox socket, hostDir/toybox.sock, is toybox's to serve.
*/
mkDarwin =
{
hostDir,
model,
upstream,
keyFile,
reasoningEffort ? null,
system ? "aarch64-darwin",
}:
let
hostPkgs = nixpkgs.legacyPackages.${system};
vm = lib.nixosSystem {
system = lib.replaceString "-darwin" "-linux" system;
modules = [
self.nixosModules.vfkit-vm
{
microvm.vmHostPackages = hostPkgs;
services.hermes-guest = {
enable = true;
inherit model reasoningEffort;
vm.hostDir = hostDir;
};
}
];
};
runner = vm.config.microvm.declaredRunner;
in
{
inherit vm runner;
host = import ./nix/darwin-host.nix {
pkgs = hostPkgs;
inherit
lib
runner
hostDir
upstream
keyFile
;
};
};
};
formatter = lib.genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ] (
system: nixpkgs.legacyPackages.${system}.nixfmt
);
};
}