nixos/doc/modular-services: run nixfmt on code blocks

This commit is contained in:
Wolfgang Walther 2025-08-05 17:08:25 +02:00
parent d3caafc32f
commit fed181fac1
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1

View File

@ -45,11 +45,18 @@ So note that the default value of `system.services.<name>` is not a complete ser
It 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:
```nix
{ config, options, lib, ... }: {
{
config,
options,
lib,
...
}:
{
_class = "service";
config = {
process.argv = [ (lib.getExe config.foo.program) ];
} // lib.optionalAttrs (options?systemd) {
}
// lib.optionalAttrs (options ? systemd) {
# ... systemd-specific definitions ...
};
}