Unverified Commit fed181fa authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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

parent d3caafc3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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 ...
  };
}