Files
oqyude 69691f96d1 fix(systemd): move the storage guard into [Unit] (T4/T52)
mkStorageGuard returned a serviceConfig fragment, so ConditionPathIsMountPoint
landed in [Service] where systemd ignores it - the guard was dead on 13 units.

- helper now returns a unitConfig fragment ([Unit]); RequiresMountsFor still
  intentionally absent
- consumers re-pointed at the real unit names: samba-smbd, phpfpm-nextcloud,
  immich-server, podman-3xui_app, podman-taperotation-{backend,frontend};
  the old serviceConfig keys silently rendered three empty phantom units
- vds excluded: otreca has no /home/oqyude/External and a live condition would
  skip podman-3xui_app and kill the 3x-ui panel at pubray1.zeroq.su

Verified: sapphira and otreca toplevel builds exit 0; all 13 units carry the
condition under [Unit] (line 3), zero occurrences under [Service].
2026-10-25 02:09:40 +03:00

77 lines
1.7 KiB
Nix

{
config,
inputs,
pkgs,
xlib,
...
}:
let
# stable = import inputs.nixpkgs-previous {
# system = "x86_64-linux";
# };
libraryDir = "${xlib.dirs.services-mnt-folder}/calibre-web-library";
sourceDir = "${xlib.dirs.services-mnt-folder}/calibre-web";
targetDir = "/var/lib/calibre-web";
in
{
services = {
calibre-web = {
# package = stable.calibre-web;
enable = true;
# dataDir = "${xlib.dirs.services-mnt-folder}/calibre-web";
options = {
calibreLibrary = "${libraryDir}";
enableBookUploading = true;
enableKepubify = true;
enableBookConversion = false;
};
listen.ip = "0.0.0.0";
listen.port = 8083;
openFirewall = true;
};
# calibre-server = {
# enable = true;
# port = 8091;
# host = "0.0.0.0";
# openFirewall = true;
# user = "calibre-web";
# group = "calibre-web";
# libraries = [
# "/var/lib/calibre-server"
# ];
# };
};
systemd = {
tmpfiles.rules =
xlib.helpers.mkTmpDirs {
dir = libraryDir;
mode = "0755";
user = "calibre-web";
group = "calibre-web";
types = [
"d"
"Z"
];
}
++ xlib.helpers.mkTmpDirs {
dir = sourceDir;
mode = "0755";
user = "calibre-web";
group = "calibre-web";
types = [
"d"
"Z"
];
};
# `unitConfig` → `[Unit]`: `ConditionPathIsMountPoint` is a unit-level
# directive and is ignored by systemd in `[Service]` (T4/R1.2).
services."calibre-web".unitConfig = xlib.helpers.mkStorageGuard xlib;
};
fileSystems = xlib.helpers.mkBindMount {
what = sourceDir;
where = targetDir;
};
}