From 8514800c42a2d292fcc81b6ecc9f0f10eef60868 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 26 May 2020 20:54:52 +0200 Subject: nixos/public-inbox: init --- pkgs/pkgs-lib/formats.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkgs/pkgs-lib') diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 5e17519d4ce1..e6e6a95c1f4a 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -123,6 +123,17 @@ rec { }; + gitIni = { listsAsDuplicateKeys ? false, ... }@args: { + + type = with lib.types; let + + iniAtom = (ini args).type/*attrsOf*/.functor.wrapped/*attrsOf*/.functor.wrapped; + + in attrsOf (attrsOf (either iniAtom (attrsOf iniAtom))); + + generate = name: value: pkgs.writeText name (lib.generators.toGitINI value); + }; + toml = {}: json {} // { type = with lib.types; let valueType = oneOf [ -- cgit 1.4.1