docs: update platform module guidance
Program and service modules are auto-imported now, so contributor docs should point platform-specific work at guarded module behavior and tests instead of loadModule.
This commit is contained in:
parent
db97e414d5
commit
f3dc0b8583
1 changed files with 7 additions and 3 deletions
|
|
@ -200,9 +200,13 @@ of the supported platforms. The most common example of platform specific
|
|||
modules are those that define systemd user services, which only works on
|
||||
Linux systems.
|
||||
|
||||
If you add a module that is platform specific then make sure to include
|
||||
a condition in the `loadModule` function call. This will make the module
|
||||
accessible only on systems where the condition evaluates to `true`.
|
||||
If you add a module that is platform specific then make sure the module
|
||||
guards platform-specific configuration with an appropriate condition, for
|
||||
example `pkgs.stdenv.hostPlatform.isLinux` or
|
||||
`pkgs.stdenv.hostPlatform.isDarwin`. Modules in `modules/programs/` and
|
||||
`modules/services/` are auto-imported, so the platform condition should live
|
||||
in the module behavior and in any platform-specific tests rather than in a
|
||||
separate module discovery call.
|
||||
|
||||
Similarly, if you are adding a news entry then it should be shown only
|
||||
to users that may find it relevant, see [News](#sec-news) for a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue