nixos/programs/blender: update addons build step

The previous one just overwrites existing directories from previous
paths if there's any similar directory.
This commit is contained in:
Gabriel Arazas 2025-01-12 14:55:16 +08:00
parent 5a0f61da58
commit 5b68cf1f04
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -7,21 +7,12 @@ let
let
blenderVersion = lib.versions.majorMinor cfg.package.version;
in
pkgs.runCommand "blender-system-resources"
{
passAsFile = [ "paths" ];
paths = cfg.addons ++ [ cfg.package ];
nativeBuildInputs = with pkgs; [ outils ];
} ''
mkdir -p $out
for i in $(cat $pathsPath); do
resourcesPath="$i/share/blender"
if [ -d $i/share/blender/${blenderVersion} ]; then
resourcesPath="$i/share/blender/${blenderVersion}";
fi
lndir -silent $resourcesPath $out
done
'';
pkgs.symlinkJoin {
name = "blender-${blenderVersion}-addons";
paths = let
_paths = cfg.addons ++ [ cfg.package ];
in lib.concatMap (p: [ "${p}/share/blender" ]) _paths;
};
in
{
options.programs.blender = {