summaryrefslogtreecommitdiffstats
path: root/configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 02:23:56 +0000
committertv <tv@krebsco.de>2026-11-21 04:08:13 +0100
commite8fea350994cea2c9e88e913bf44d9fb5ec3b793 (patch)
treeb1d1aa140ed214e33281dc56e0508e648d76919c /configs
parent59fbd4518770b88d7e8a1e7c13b4789df23cf9d3 (diff)
configs: fail the services without the home drive
RequiresMountsFor only requires home.mount if there is one, which the fc-home generator only makes with the drive (--home): without it, the services started anyway, with their state on the tmpfs. Now they assert that /home is a mount point, and fail otherwise.
Diffstat (limited to 'configs')
-rw-r--r--configs/claude.nix3
-rw-r--r--configs/hermes.nix14
2 files changed, 14 insertions, 3 deletions
diff --git a/configs/claude.nix b/configs/claude.nix
index 683e287..8f02532 100644
--- a/configs/claude.nix
+++ b/configs/claude.nix
@@ -61,6 +61,9 @@ in
wants = [ "network-online.target" ];
after = [ "network-online.target" "systemd-tmpfiles-setup.service" ];
unitConfig.RequiresMountsFor = "/home/claude";
+ # Without the drive, there's no mount to require, and /home is on the
+ # tmpfs: fail rather than keep the state there.
+ unitConfig.AssertPathIsMountPoint = "/home";
path = [
claude-code
config.nix.package
diff --git a/configs/hermes.nix b/configs/hermes.nix
index 598a067..36fb9b3 100644
--- a/configs/hermes.nix
+++ b/configs/hermes.nix
@@ -36,6 +36,12 @@ let
'';
});
+ # The home drive, for hermes' services, see there.
+ homeMount = {
+ RequiresMountsFor = config.services.hermes-agent.stateDir;
+ AssertPathIsMountPoint = "/home";
+ };
+
# Root's way into hermes' tmux; attaching starts it (see hermes-tmux).
hermes-attach = pkgs.writeShellScriptBin "hermes-attach" ''
exec ${tmux} attach -t hermes
@@ -170,9 +176,11 @@ in
systemd.tmpfiles.rules = lib.mkBefore [
"d ${config.services.hermes-agent.stateDir} 0700 hermes hermes -"
];
- systemd.services.hermes-agent-setup.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir;
- systemd.services.hermes-agent.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir;
- systemd.services.hermes-tmux.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir;
+ # Without the drive, there's no mount to require, and /home is on the
+ # tmpfs: fail rather than keep the state there.
+ systemd.services.hermes-agent-setup.unitConfig = homeMount;
+ systemd.services.hermes-agent.unitConfig = homeMount;
+ systemd.services.hermes-tmux.unitConfig = homeMount;
# hermes' home is stateDir, so this uses the service's state at ~/.hermes.
# tmux lets root attach to it. Socket-activated: the first client