1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 17:11:03 +01:00

jq: add missing color option (#6734)

added "color for object keys" option
https://jqlang.org/manual/#colors
This commit is contained in:
krabodyan 2025-04-02 17:26:34 +03:00 committed by GitHub
parent 5ee44bc7c2
commit 81f38986a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 8 deletions

View file

@ -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}";
};
};
}