From 28a227a89093d425d93d9b7d373af0634e77a534 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 31 Mar 2022 11:52:12 +0200 Subject: [PATCH] formats.javaProperties: Add documentation --- .../development/settings-options.section.md | 14 ++++++++ .../development/settings-options.section.xml | 32 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/nixos/doc/manual/development/settings-options.section.md b/nixos/doc/manual/development/settings-options.section.md index f9bb6ff9cc4..d569e23adbd 100644 --- a/nixos/doc/manual/development/settings-options.section.md +++ b/nixos/doc/manual/development/settings-options.section.md @@ -32,6 +32,20 @@ type of this option should represent the format. The most common formats have a predefined type and string generator already declared under `pkgs.formats`: +`pkgs.formats.javaProperties` { *`comment`* ? `"Generated with Nix"` } + +: A function taking an attribute set with values + + `comment` + + : A string to put at the start of the + file in a comment. It can have multiple + lines. + + It returns the `type`: `attrsOf str` and a function + `generate` to build a Java `.properties` file, taking + care of the correct escaping, etc. + `pkgs.formats.json` { } : A function taking an empty attribute set (for future extensibility) diff --git a/nixos/doc/manual/from_md/development/settings-options.section.xml b/nixos/doc/manual/from_md/development/settings-options.section.xml index 746011a2d07..d26dd96243d 100644 --- a/nixos/doc/manual/from_md/development/settings-options.section.xml +++ b/nixos/doc/manual/from_md/development/settings-options.section.xml @@ -53,6 +53,38 @@ pkgs.formats: + + + pkgs.formats.javaProperties { + comment ? + "Generated with Nix" } + + + + A function taking an attribute set with values + + + + + comment + + + + A string to put at the start of the file in a comment. + It can have multiple lines. + + + + + + It returns the type: + attrsOf str and a function + generate to build a Java + .properties file, taking care of the + correct escaping, etc. + + + pkgs.formats.json { }