at master 1.1 kB view raw
1/** 2 Renders documentation for modular services. 3 For inclusion into documentation.nixos.extraModules. 4*/ 5{ lib, pkgs, ... }: 6let 7 /** 8 Causes a modular service's docs to be rendered. 9 This is an intermediate solution until we have "native" service docs in some nicer form. 10 */ 11 fakeSubmodule = 12 module: 13 lib.mkOption { 14 type = lib.types.submoduleWith { 15 modules = [ module ]; 16 }; 17 description = "This is a [modular service](https://nixos.org/manual/nixos/unstable/#modular-services), which can be imported into a NixOS configuration using the [`system.services`](https://search.nixos.org/options?channel=unstable&show=system.services&query=modular+service) option."; 18 }; 19 20 modularServicesModule = { 21 _file = "${__curPos.file}:${toString __curPos.line}"; 22 options = { 23 "<imports = [ pkgs.ghostunnel.services.default ]>" = fakeSubmodule pkgs.ghostunnel.services.default; 24 "<imports = [ pkgs.php.services.default ]>" = fakeSubmodule pkgs.php.services.default; 25 }; 26 }; 27in 28{ 29 documentation.nixos.extraModules = [ 30 modularServicesModule 31 ]; 32}