···45It is possible to write service modules that are portable. This is done by either avoiding the `systemd` option tree, or by defining process-manager-specific definitions in an optional way:
4647```nix
48-{ config, options, lib, ... }: {
00000049 _class = "service";
50 config = {
51 process.argv = [ (lib.getExe config.foo.program) ];
52- } // lib.optionalAttrs (options?systemd) {
053 # ... systemd-specific definitions ...
54 };
55}
···45It is possible to write service modules that are portable. This is done by either avoiding the `systemd` option tree, or by defining process-manager-specific definitions in an optional way:
4647```nix
48+{
49+ config,
50+ options,
51+ lib,
52+ ...
53+}:
54+{
55 _class = "service";
56 config = {
57 process.argv = [ (lib.getExe config.foo.program) ];
58+ }
59+ // lib.optionalAttrs (options ? systemd) {
60 # ... systemd-specific definitions ...
61 };
62}