# On a Linux host: Hermes's unit runs here, confined by systemd, and the # host's systemd serves both of its sockets. { config, lib, ... }: let cfg = config.services.hermes-guest; in { imports = [ ./hermes-guest.nix ./llm-proxy.nix ]; options.services.hermes-guest.hostSocketUnit = lib.mkOption { type = lib.types.str; example = "endo-guest-hermes.socket"; description = '' The socket unit that serves hostSocket: the guest's host (toybox, say), bound to Hermes's guest agent, with SocketUser set to Hermes's user and SocketMode 0600. ''; }; options.services.hermes-guest.downloadsUser = lib.mkOption { type = lib.types.str; example = "toybox"; description = "The host's user, who writes downloadsDir; Hermes's group may read it."; }; config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d ${cfg.downloadsDir} 0750 ${cfg.downloadsUser} ${config.services.hermes-agent.group} -" ]; services.hermes-llm-proxy = { enable = true; socket = cfg.llmSocket; socketUser = config.services.hermes-agent.user; }; systemd.services.hermes-agent = { after = [ "hermes-llm.socket" cfg.hostSocketUnit ]; requires = [ "hermes-llm.socket" cfg.hostSocketUnit ]; }; }; }