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>
52 lines
1.1 KiB
Nix
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"
|
|
]
|
|
)
|
|
);
|
|
}
|
|
)
|
|
];
|
|
}
|