nixos/documentation/modular-services: init (#430876)

authored by Robert Hensing and committed by GitHub 3f63b0cf 3b5e1ef5

+32
+31
nixos/modules/misc/documentation/modular-services.nix
··· 1 + /** 2 + Renders documentation for modular services. 3 + For inclusion into documentation.nixos.extraModules. 4 + */ 5 + { lib, pkgs, ... }: 6 + let 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 + }; 25 + }; 26 + in 27 + { 28 + documentation.nixos.extraModules = [ 29 + modularServicesModule 30 + ]; 31 + }
+1
nixos/modules/module-list.nix
··· 139 139 ./misc/assertions.nix 140 140 ./misc/crashdump.nix 141 141 ./misc/documentation.nix 142 + ./misc/documentation/modular-services.nix 142 143 ./misc/extra-arguments.nix 143 144 ./misc/ids.nix 144 145 ./misc/label.nix