1 { lib, formats, stdenvNoCC, writeText, ... }:
3 hocon = formats.hocon { };
5 include_file = (writeText "hocon-test-include.conf" ''
7 '').overrideAttrs (_: _: {
8 outputHashAlgo = "sha256";
9 outputHashMode = "flat";
10 outputHash = "sha256-UhkJLhT3bD6znq+IdDjs/ahP19mLzrLCy/R14pVrfew=";
14 simple_top_level_attr = "1.0";
15 nested.attrset.has.a.integer.value = 100;
22 nasty_string = "\"@\n\\\t^*\b\f\n\0\";'''$";
26 y = hocon.lib.mkAppend { a = 1; };
29 "cursed \" .attrs \" " = {
31 "a b" = hocon.lib.mkSubstitution "a";
32 "a b c" = hocon.lib.mkSubstitution {
40 (hocon.lib.mkInclude include_file)
41 (hocon.lib.mkInclude "https://example.com")
42 (hocon.lib.mkInclude {
47 (hocon.lib.mkInclude { value = include_file; })
48 (hocon.lib.mkInclude {
49 value = "https://example.com";
56 hocon-test-conf = hocon.generate "hocon-test.conf" expression;
58 stdenvNoCC.mkDerivation {
59 name = "pkgs.formats.hocon-test-comprehensive";
68 diff -U3 ${./expected.txt} ${hocon-test-conf}
77 cp ${./expected.txt} $out/expected.txt
78 cp ${hocon-test-conf} $out/hocon-test.conf
79 cp ${hocon-test-conf.passthru.json} $out/hocon-test.json