How to get Cuda working in Blender?

Seems like a good solution as well, but if you want to use the binary package, you can add in your input

inputs.blender-bin.url = "github:edolstra/nix-warez?dir=blender";

and in the list of modules add

modules = [
  # Add the overlay of blender-bin
  ({config, pkgs, ...}: { nixpkgs.overlays = [ blender-bin.overlays.default ]; })
  # In configuration.nix, you can now refer to blender_4_0 in environment.systemPackages
  ./configuration.nix
]

Full version:

{
  description = "The configuration of my system";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    blender-bin.url = "github:edolstra/nix-warez?dir=blender";
  };
  
  outputs = { self, nixpkgs, blender-bin, ... }@inputs: {
    nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({config, pkgs, ...}: {
          nixpkgs.overlays = [ blender-bin.overlays.default ];
          # This line can either be here or in configuration.nix
          environment.systemPackages = with pkgs; [ blender_4_0 ];
        })
        ./configuration.nix
      ];
    };
  };
}
1 Like