diff --git a/modules/misc/news.nix b/modules/misc/news.nix index e3c10d1f6..bf524974b 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -2211,6 +2211,17 @@ in { Nix's store) old Home-Manager generations. ''; } + + { + time = "2025-03-31T16:39:41+00:00"; + condition = config.programs.jq.enable; + message = '' + Jq module now supports color for object keys + + Your configuration will break if you have defined the "programs.jq.colors" option. + To resolve this, please add `objectKeys` to your assignment of `programs.jq.colors`. + ''; + } ]; }; } diff --git a/modules/programs/jq.nix b/modules/programs/jq.nix index 3bd522d62..032201d60 100644 --- a/modules/programs/jq.nix +++ b/modules/programs/jq.nix @@ -20,6 +20,7 @@ let strings = colorType; arrays = colorType; objects = colorType; + objectKeys = colorType; }; }; @@ -45,13 +46,14 @@ in { example = lib.literalExpression '' { - null = "1;30"; - false = "0;31"; - true = "0;32"; - numbers = "0;36"; - strings = "0;33"; - arrays = "1;35"; - objects = "1;37"; + null = "1;30"; + false = "0;31"; + true = "0;32"; + numbers = "0;36"; + strings = "0;33"; + arrays = "1;35"; + objects = "1;37"; + objectKeys = "1;34"; } ''; @@ -63,6 +65,7 @@ in { strings = "0;32"; arrays = "1;37"; objects = "1;37"; + objectKeys = "1;34"; }; type = colorsType; @@ -76,7 +79,7 @@ in { home.sessionVariables = let c = cfg.colors; in { JQ_COLORS = - "${c.null}:${c.false}:${c.true}:${c.numbers}:${c.strings}:${c.arrays}:${c.objects}"; + "${c.null}:${c.false}:${c.true}:${c.numbers}:${c.strings}:${c.arrays}:${c.objects}:${c.objectKeys}"; }; }; }