11.stylix/modules/blender/hm.nix
Flameopathic 4bc15ef13c
blender: use mkTarget (#1509)
Link: https://github.com/nix-community/stylix/pull/1509

Reviewed-by: awwpotato <awwpotato@voidq.com>
Tested-by: Louis Dalibard <louis.dalibard@gmail.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-07-01 16:13:57 +02:00

52 lines
1.1 KiB
Nix

{
mkTarget,
lib,
...
}:
mkTarget {
name = "blender";
humanName = "Blender";
extraOptions.themeBody = lib.mkOption {
type = lib.types.lines;
default = "";
internal = true;
};
configElements = [
./color-theme.nix
./font-theme.nix
(
{ cfg }:
{
xdg.configFile =
let
indent =
string: " " + lib.concatStringsSep "\n " (lib.splitString "\n" string);
in
lib.mkIf (cfg.themeBody != "") (
builtins.listToAttrs (
map
(
version:
lib.nameValuePair
"blender/${version}/scripts/presets/interface_theme/Stylix.xml"
{
text = lib.concatLines [
"<bpy>"
(indent cfg.themeBody)
"</bpy>"
];
}
)
[
"4.2"
"4.3"
"4.4"
]
)
);
}
)
];
}