feat(blender): optional CUDA build
Off by default: it is only useful on an NVIDIA host, and no binary cache serves it (cuda-maintainers was measured to change nothing), so enabling it rebuilds Blender, OpenUSD, OpenSubdiv and OpenImageDenoise. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+34
-11
@@ -1,20 +1,43 @@
|
|||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.custom.blender;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
options.custom.blender = {
|
||||||
blender
|
cuda = lib.mkOption {
|
||||||
prusa-slicer
|
type = lib.types.bool;
|
||||||
];
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Build Blender with CUDA/OptiX so Cycles renders on the GPU instead of
|
||||||
|
the CPU. Only useful on an NVIDIA host; enabling it on arrakis (Intel)
|
||||||
|
would mean a long build for nothing.
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
No binary cache serves this — cuda-maintainers was measured to make no
|
||||||
|
difference — so flipping this on rebuilds Blender, OpenUSD, OpenSubdiv
|
||||||
|
and OpenImageDenoise from source.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
xdg.desktopEntries.prusaslicer-url-handler = {
|
config = {
|
||||||
name = "PrusaSlicer Protocol Handler";
|
home.packages = [
|
||||||
exec = "prusa-slicer %u";
|
(if cfg.cuda then pkgs.blender.override { cudaSupport = true; } else pkgs.blender)
|
||||||
type = "Application";
|
pkgs.prusa-slicer
|
||||||
noDisplay = true;
|
];
|
||||||
mimeType = [ "x-scheme-handler/prusaslicer" ];
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
xdg.desktopEntries.prusaslicer-url-handler = {
|
||||||
|
name = "PrusaSlicer Protocol Handler";
|
||||||
|
exec = "prusa-slicer %u";
|
||||||
|
type = "Application";
|
||||||
|
noDisplay = true;
|
||||||
|
mimeType = [ "x-scheme-handler/prusaslicer" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user