mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
lib/env-specific/wrapper-manager: add plumbing for wrapping Blender
This commit is contained in:
parent
53cd1864df
commit
b03032daff
@ -1,6 +1,6 @@
|
||||
{ pkgs, lib, self }:
|
||||
|
||||
{
|
||||
rec {
|
||||
/* Given a Blender package and its addons to be wrapped, create a derivation
|
||||
containing all of the addons properly placed as a system resource folder.
|
||||
*/
|
||||
@ -23,4 +23,21 @@
|
||||
lndir -silent $resourcesPath $out
|
||||
done
|
||||
'';
|
||||
|
||||
makeBlenderWrapper = module@{ blenderPackage, blenderArgs ? [ ] , addons ? [ ], ... }:
|
||||
let
|
||||
blenderAddons = wrapBlenderAddons { inherit blenderPackage addons; };
|
||||
in
|
||||
lib.mkMerge [
|
||||
{
|
||||
arg0 = lib.getExe' blenderPackage "blender";
|
||||
prependArgs = lib.mkBefore blenderArgs;
|
||||
}
|
||||
|
||||
(lib.mkIf (builtins.length addons > 0) {
|
||||
env.BLENDER_SYSTEM_RESOURCES = blenderAddons;
|
||||
})
|
||||
|
||||
(lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ])
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user