diff options
author | Minijackson <minijackson@riseup.net> | 2021-04-10 16:04:35 +0200 |
---|---|---|
committer | Yt <raphael@megzari.com> | 2022-02-28 07:09:10 -0500 |
commit | 6a96ddb67509064c2d445b3fae73d4c4c38c539d (patch) | |
tree | a58b0d66d441e0ee933710e399b5f90e15eb4a2e /nixos/doc/manual/development/settings-options.section.md | |
parent | ea84cd68951eb7b61590d7501f7ee602ecf9ba2c (diff) | |
download | nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar.gz nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar.bz2 nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar.lz nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar.xz nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.tar.zst nixpkgs-6a96ddb67509064c2d445b3fae73d4c4c38c539d.zip |
pkgs-lib: Implement settings format for Elixir
Diffstat (limited to 'nixos/doc/manual/development/settings-options.section.md')
-rw-r--r-- | nixos/doc/manual/development/settings-options.section.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nixos/doc/manual/development/settings-options.section.md b/nixos/doc/manual/development/settings-options.section.md index 58a3d8448af..f9bb6ff9cc4 100644 --- a/nixos/doc/manual/development/settings-options.section.md +++ b/nixos/doc/manual/development/settings-options.section.md @@ -66,6 +66,45 @@ have a predefined type and string generator already declared under and returning a set with TOML-specific attributes `type` and `generate` as specified [below](#pkgs-formats-result). +`pkgs.formats.elixirConf { elixir ? pkgs.elixir }` + +: A function taking an attribute set with values + + `elixir` + + : The Elixir package which will be used to format the generated output + + It returns a set with Elixir-Config-specific attributes `type`, `lib`, and + `generate` as specified [below](#pkgs-formats-result). + + The `lib` attribute contains functions to be used in settings, for + generating special Elixir values: + + `mkRaw elixirCode` + + : Outputs the given string as raw Elixir code + + `mkGetEnv { envVariable, fallback ? null }` + + : Makes the configuration fetch an environment variable at runtime + + `mkAtom atom` + + : Outputs the given string as an Elixir atom, instead of the default + Elixir binary string. Note: lowercase atoms still needs to be prefixed + with `:` + + `mkTuple array` + + : Outputs the given array as an Elixir tuple, instead of the default + Elixir list + + `mkMap attrset` + + : Outputs the given attribute set as an Elixir map, instead of the + default Elixir keyword list + + ::: {#pkgs-formats-result} These functions all return an attribute set with these values: ::: @@ -74,6 +113,12 @@ These functions all return an attribute set with these values: : A module system type representing a value of the format +`lib` + +: Utility functions for convenience, or special interactions with the format. + This attribute is optional. It may contain inside a `types` attribute + containing types specific to this format. + `generate` *`filename jsonValue`* : A function that can render a value of the format to a file. Returns |