blender: init (#1147)

Link: https://github.com/nix-community/stylix/pull/1147

Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: awwpotato <awwpotato@voidq.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Louis Dalibard 2025-06-04 18:10:45 +02:00 committed by GitHub
parent 0db3ec0215
commit a057acc112
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1600 additions and 0 deletions

View file

@ -0,0 +1,4 @@
> [!IMPORTANT]
> The Blender target will have no effect unless the Blender theme is properly
> [enabled](https://docs.blender.org/manual/en/latest/editors/preferences/themes.html)
> within Blender itself.

File diff suppressed because it is too large Load diff

46
modules/blender/hm.nix Normal file
View file

@ -0,0 +1,46 @@
{
config,
lib,
...
}:
{
options.stylix.targets.blender.enable =
config.lib.stylix.mkEnableTarget "blender" true;
config =
lib.mkIf (config.stylix.enable && config.stylix.targets.blender.enable)
{
xdg.configFile =
let
theme = builtins.readFile (
config.lib.stylix.colors {
template = ./Stylix.xml.mustache;
extension = ".xml";
}
);
in
builtins.listToAttrs (
map
(
version:
lib.nameValuePair
"blender/${version}/scripts/presets/interface_theme/Stylix.xml"
{
text =
builtins.replaceStrings
[ "%POPUPSFONTSIZE%" "%DESKTOPFONTSIZE%" ]
[
(toString config.stylix.fonts.sizes.popups)
(toString config.stylix.fonts.sizes.desktop)
]
theme;
}
)
[
"4.2"
"4.3"
"4.4"
]
);
};
}

6
modules/blender/meta.nix Normal file
View file

@ -0,0 +1,6 @@
{ lib, ... }:
{
maintainers = [ lib.maintainers.make-42 ];
name = "Blender";
homepage = "https://www.blender.org/";
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
let
package = pkgs.blender;
in
{
stylix.testbed.ui.application = {
name = "blender";
inherit package;
};
environment.systemPackages = [ package ];
}