From 52892ca231b79eb09fd0270591d56f75e8e65d49 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 02:35:23 +0000 Subject: configs/hermes: keep perl out of the closure profiles/perlless forbids perl in the system closure, and hermes-agent brought it in twice: nixpkgs' git (send-email, gitweb & co.), on the package's runtime PATH and the module's unit PATH, and wl-clipboard, whose xdg-utils needs perl. Override the package with gitMinimal and without wl-clipboard, which has no use without Wayland, and replace the unit's PATH, as the package brings git itself. --- configs/hermes.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configs/hermes.nix b/configs/hermes.nix index ea1fd9b..66b1094 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -61,6 +61,13 @@ in services.hermes-agent = { enable = true; + # Without perl, as profiles/perlless forbids it in the closure: git + # without send-email & co., and no wl-clipboard, whose xdg-utils needs + # perl, and which is no use here anyway. + package = hermes-agent.packages.${pkgs.stdenv.hostPlatform.system}.default.override { + git = pkgs.gitMinimal; + wl-clipboard = pkgs.emptyDirectory; + }; # /var is a tmpfs. This is on the only drive that can outlive a boot, # like nix's database, see /nix/var. stateDir = "/nix/.rw-store/hermes"; @@ -93,6 +100,13 @@ in if [ "$USER" = root ] && [ -z "$TMUX" ]; then ${tmux} attach -t hermes; fi ''; + # The module adds pkgs.git, which needs perl; the package has gitMinimal. + systemd.services.hermes-agent.path = lib.mkForce [ + config.services.hermes-agent.package + pkgs.bash + pkgs.coreutils + ]; + # nixos-init doesn't run activation scripts, and that's where the module # creates the state and installs config.yaml and .env. systemd.services.hermes-agent-setup = { -- cgit v1.3.1