hocon: remove deprecated indicators

This was scheduled for 24.11.

+1 -136
+1 -38
pkgs/pkgs-lib/formats/hocon/default.nix
··· 101 lib = hoconLib; 102 103 generate = name: value: 104 - let 105 - # TODO: remove in 24.11 106 - # Backwards compatibility for generators in the following locations: 107 - # - nixos/modules/services/networking/jibri/default.nix (__hocon_envvar) 108 - # - nixos/modules/services/networking/jicofo.nix (__hocon_envvar, __hocon_unquoted_string) 109 - # - nixos/modules/services/networking/jitsi-videobridge.nix (__hocon_envvar) 110 - replaceOldIndicators = value: 111 - if lib.isAttrs value then 112 - (if value ? "__hocon_envvar" 113 - then 114 - lib.warn '' 115 - Use of `__hocon_envvar` has been deprecated, and will 116 - be removed in the future. 117 - 118 - Please use `(pkgs.formats.hocon {}).lib.mkSubstitution` instead. 119 - '' 120 - (hoconLib.mkSubstitution value.__hocon_envvar) 121 - else if value ? "__hocon_unquoted_string" 122 - then 123 - lib.warn '' 124 - Use of `__hocon_unquoted_string` has been deprecated, and will 125 - be removed in the future. 126 - 127 - Please make use of the freeform options of 128 - `(pkgs.formats.hocon {}).format` instead. 129 - '' 130 - { 131 - value = value.__hocon_unquoted_string; 132 - _type = "unquoted_string"; 133 - } 134 - else lib.mapAttrs (_: replaceOldIndicators) value) 135 - else if lib.isList value 136 - then map replaceOldIndicators value 137 - else value; 138 - 139 - finalValue = replaceOldIndicators value; 140 - in 141 callPackage 142 ({ 143 stdenvNoCC ··· 151 dontUnpack = true; 152 preferLocalBuild = true; 153 154 - json = builtins.toJSON finalValue; 155 passAsFile = [ "json" ]; 156 157 strictDeps = true;
··· 101 lib = hoconLib; 102 103 generate = name: value: 104 callPackage 105 ({ 106 stdenvNoCC ··· 114 dontUnpack = true; 115 preferLocalBuild = true; 116 117 + json = builtins.toJSON value; 118 passAsFile = [ "json" ]; 119 120 strictDeps = true;
-65
pkgs/pkgs-lib/formats/hocon/test/backwards-compatibility/default.nix
··· 1 - { formats, stdenvNoCC, ... }: 2 - let 3 - hocon = formats.hocon { }; 4 - 5 - expression = { 6 - substitution = { __hocon_envvar = "PATH"; }; 7 - literal = { 8 - __hocon_unquoted_string = '' 9 - [ 10 - 1, 11 - "a", 12 - ]''; 13 - }; 14 - 15 - nested = { 16 - substitution = { __hocon_envvar = "PATH"; }; 17 - literal = { 18 - __hocon_unquoted_string = '' 19 - [ 20 - 1, 21 - "a", 22 - ]''; 23 - }; 24 - }; 25 - 26 - nested_in_array = [ 27 - { __hocon_envvar = "PATH"; } 28 - { 29 - __hocon_unquoted_string = '' 30 - [ 31 - 1, 32 - "a", 33 - ]''; 34 - } 35 - ]; 36 - }; 37 - 38 - hocon-test-conf = hocon.generate "hocon-test.conf" expression; 39 - in 40 - stdenvNoCC.mkDerivation { 41 - name = "pkgs.formats.hocon-test-backwards-compatibility"; 42 - 43 - dontUnpack = true; 44 - dontBuild = true; 45 - 46 - doCheck = true; 47 - checkPhase = '' 48 - runHook preCheck 49 - 50 - diff -U3 ${./expected.txt} ${hocon-test-conf} 51 - 52 - runHook postCheck 53 - ''; 54 - 55 - installPhase = '' 56 - runHook preInstall 57 - 58 - mkdir $out 59 - cp ${./expected.txt} $out/expected.txt 60 - cp ${hocon-test-conf} $out/hocon-test.conf 61 - cp ${hocon-test-conf.passthru.json} $out/hocon-test.json 62 - 63 - runHook postInstall 64 - ''; 65 - }
···
-22
pkgs/pkgs-lib/formats/hocon/test/backwards-compatibility/expected.txt
··· 1 - { 2 - "literal" = [ 3 - 1, 4 - "a", 5 - ] 6 - "nested" = { 7 - "literal" = [ 8 - 1, 9 - "a", 10 - ] 11 - "substitution" = ${?PATH} 12 - } 13 - "nested_in_array" = [ 14 - ${?PATH}, 15 - [ 16 - 1, 17 - "a", 18 - ] 19 - ] 20 - "substitution" = ${?PATH} 21 - } 22 -
···
-11
pkgs/pkgs-lib/formats/hocon/test/default.nix
··· 1 { pkgs, ... }: 2 { 3 comprehensive = pkgs.callPackage ./comprehensive { }; 4 - backwards-compatibility = 5 - let 6 - pkgsNoWarn = pkgs.extend (final: prev: { 7 - lib = prev.lib.extend (libFinal: libPrev: { 8 - warn = msg: v: v; 9 - trivial = libPrev.trivial // { 10 - warn = msg: v: v; 11 - }; 12 - }); 13 - }); 14 - in pkgsNoWarn.callPackage ./backwards-compatibility { }; 15 }
··· 1 { pkgs, ... }: 2 { 3 comprehensive = pkgs.callPackage ./comprehensive { }; 4 }