2.home-manager/tests/modules
cinereal fb6a0c6d39 modules: add modular services support
Adds `home.services`, an attribute set of nixpkgs
[modular services](https://nixos.org/manual/nixos/unstable/#modular-services)
sourced from `<nixpkgs/lib/services/lib.nix>`. Each service exposes
`process.argv` and the upstream NixOS-style systemd schema
(`systemd.lib`, `systemd.mainExecStart`, `systemd.service`,
`systemd.services`, `systemd.sockets`) by re-exporting
`nixos/modules/system/service/systemd/service.nix`. Service modules
shipped with `_class = "service"` (e.g.
`pkgs.<name>.passthru.services.default`) drop in unchanged --
service portability across module systems is the point of modular
services.

Lifted units are evaluated and translated from NixOS-style attrs
(`wantedBy`, `serviceConfig`, `unitConfig`, `environment`, ...) into
the section-based INI shape (`{ Unit; Service; Install; }`) that
home-manager's `systemd.user.{services,sockets}` consumes; only the
common keys are mapped, uncommon options remain reachable via
`unitConfig` / `serviceConfig` / `socketConfig`. Sub-services and
their units are dashed under the parent service name;
`process.argv` becomes the default `ExecStart` for the service's
primary unit, which defaults to `WantedBy=default.target`.

Mirrors the surface of nixpkgs' portable systemd module (services +
sockets only); other unit kinds home-manager supports natively
(timers etc.) are intentionally not modeled until upstream grows
them.

Each service's `configData.<name>` entries are materialized at
`$XDG_CONFIG_HOME/system-services/<service-prefix>/<name>` (mirroring
how `nixos/modules/system/service/systemd/{config-data-path,system}.nix`
lifts `configData` to `environment.etc`), with the absolute path
injected back into `configData.<name>.path` so the service can refer
to its files at a stable location.

Includes nmt tests covering: a basic `process.argv`-only service, a
service with a `configData` entry, and importing
`pkgs.ghostunnel.passthru.services.default` to assert the lifted user
unit contains the expected ExecStart flags and `LoadCredential`
entries.
2026-05-04 17:22:16 +02:00
..
accounts treewide: mark unused lambda arguments 2026-04-13 22:02:40 -05:00
config treewide: remove unused attrs patterns 2026-04-13 22:02:40 -05:00
dbus dbus: Create with pacakges options (#7064) 2025-05-15 12:59:12 -05:00
files files: handle overlapping file targets 2026-04-07 23:33:05 -05:00
home-environment shell: support boolean sessionVariables 2026-05-02 09:50:08 -05:00
i18n/input-method fcitx5: capitalize boolean settings 2026-04-23 18:12:37 -05:00
launchd launchd: wait for /nix/store before starting agent (#8609) 2026-01-27 21:51:48 -08:00
misc xdg-autostart: allow empty readonly autostart 2026-04-20 11:12:32 -05:00
programs vscode: warn when package is a known fork and remove pname option 2026-05-03 18:50:49 -05:00
services treewide: remove network-online.target 2026-05-03 08:36:38 -05:00
services-modular modules: add modular services support 2026-05-04 17:22:16 +02:00
systemd treewide: remove unused attrs patterns 2026-04-13 22:02:40 -05:00
targets-darwin targets/darwin: set TERMINFO_DIRS 2026-04-26 10:44:45 -05:00
targets-linux treewide: remove unused attrs patterns 2026-04-13 22:02:40 -05:00
xresources treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00