25 # blendfarm (client) will run from the current workdir.
26 # It needs to create files there, so it cannot be in the nix store.
27 # We also need to create some files there so it can work with its
29 USERHOMEDIR = "~/.local/share/blendfarm";
30 blendfarm-nix = writeShellScriptBin "blendfarm-nix" ''
31 if [[ -z $BLENDFARM_HOME && ! -d ${USERHOMEDIR} ]]; then
32 echo "Creating home for blendfarm at ${USERHOMEDIR}"
33 echo "You can change that by setting BLENDFARM_HOME to another directory"
35 if [[ -z $BLENDFARM_HOME ]]; then
36 BLENDFARM_HOME=${USERHOMEDIR}
38 mkdir -p $BLENDFARM_HOME/BlenderData/nix-blender-linux64 > /dev/null 2>&1
39 ln -s ${lib.getExe blender} $BLENDFARM_HOME/BlenderData/nix-blender-linux64/blender > /dev/null 2>&1
40 echo "nix-blender" > $BLENDFARM_HOME/VersionCustom
42 exec -a "$0" @out@/bin/LogicReinc.BlendFarm "$@"
46 buildDotnetModule rec {
50 src = fetchFromGitHub {
52 repo = "LogicReinc.BlendFarm";
54 hash = "sha256-2w2tdl5n0IFTuthY97NYMeyRe2r72jaKFfoNSjWQMM4=";
59 ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]
60 ++ lib.optionals stdenv.hostPlatform.isDarwin [
63 darwin.autoSignDarwinBinariesHook
67 (lib.getLib stdenv.cc.cc)
80 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ blender ];
82 # there is no "*.so.3" or "*.so.5" in nixpkgs. So ignore the warning
84 autoPatchelfIgnoreMissingDeps = [
89 dotnet-sdk = dotnetCorePackages.sdk_6_0;
90 dotnet-runtime = dotnetCorePackages.runtime_6_0;
93 "LogicReinc.BlendFarm.Client/LogicReinc.BlendFarm.Client.csproj"
94 "LogicReinc.BlendFarm.Server/LogicReinc.BlendFarm.Server.csproj"
95 "LogicReinc.BlendFarm/LogicReinc.BlendFarm.csproj"
97 nugetDeps = ./deps.nix;
99 "LogicReinc.BlendFarm"
100 "LogicReinc.BlendFarm.Server"
103 # add libraries not found by autopatchelf
104 libPath = lib.makeLibraryPath [
108 makeWrapperArgs = [ "--prefix LD_LIBRARY_PATH : ${libPath}" ];
111 lib.optionalString stdenv.hostPlatform.isLinux ''
113 cp -v ${blendfarm-nix}/bin/blendfarm-nix $out/bin
114 substituteInPlace $out/bin/blendfarm-nix --subst-var out
116 + lib.optionalString stdenv.hostPlatform.isDarwin ''
117 ln -s ${libgdiplus}/lib/libgdiplus.dylib $out/lib/blendfarm/
121 description = "A open-source, cross-platform, stand-alone, Network Renderer for Blender";
122 homepage = "https://github.com/LogicReinc/LogicReinc.BlendFarm";
123 license = with licenses; [ gpl3Plus ];
124 maintainers = with maintainers; [ gador ];
125 mainProgram = "blendfarm-nix";
126 platforms = platforms.unix;