1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Service unit generators — Task 9 §F.
//!
//! Each submodule emits a platform-native service descriptor as a `String`.
//! The generators are pure functions: `&DaemonConfig` + `&InstallOptions` →
//! `String`. No OS API calls are made; tests run on any host regardless of
//! target OS.
//!
//! # Platform gating
//!
//! | Module | `cfg` gate | Subcommand |
//! |-------------|------------------------------|--------------------------|
//! | `systemd` | `target_os = "linux"` | `install-systemd-user/system` |
//! | `launchd` | `target_os = "macos"` | `install-launchd` |
//! | `windows` | `target_os = "windows"` | `install-windows` |
//!
//! # Design reference
//!
//! `docs/reviews/sqryd-daemon/2026-04-19/task-9-design_iter3_request.md`
//! §F.1–§F.4 + §F.5 (testing).
/// systemd user + system unit generators (Task 9 U6, Linux only).
///
/// Exports [`systemd::generate_user_unit`] and [`systemd::generate_system_unit`].
/// [`systemd::resolve_system_unit_user`] validates the `%i` account name before
/// `generate_system_unit` is called.
/// launchd user-agent plist generator (Task 9 U7, macOS only).
///
/// Exports [`launchd::generate_plist`], [`launchd::default_install_path`],
/// and the constants [`launchd::PLIST_LABEL`] / [`launchd::INSTALL_PATH`].
// ---------------------------------------------------------------------------
// Shared types.
// ---------------------------------------------------------------------------
/// Options forwarded to every service-unit generator.
///
/// Passed alongside `&DaemonConfig` to each `generate_*` function so that
/// per-install overrides (e.g. a specific service account on the system
/// systemd unit, or a custom label on the launchd plist) can be supplied
/// without touching the config file.