diff --git a/flake.lock b/flake.lock index bf97ff20..ced51ad0 100644 --- a/flake.lock +++ b/flake.lock @@ -24,28 +24,6 @@ "type": "github" } }, - "blender-bin": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "dir": "blender", - "lastModified": 1766785730, - "narHash": "sha256-R0SImlpvVtp4gBCjWtrjyWlir2vMEs03XdVBJtsryUU=", - "owner": "edolstra", - "repo": "nix-warez", - "rev": "32a73188c4026cea3f8ed97078ace45bf9f7f578", - "type": "github" - }, - "original": { - "dir": "blender", - "owner": "edolstra", - "repo": "nix-warez", - "type": "github" - } - }, "bun2nix": { "inputs": { "flake-parts": [ @@ -675,6 +653,22 @@ "type": "github" } }, + "nixpkgs-blender": { + "locked": { + "lastModified": 1784871293, + "narHash": "sha256-bf8Gay/Vopie4kGiw1qg1PQBKL4MNU7Li9ThI80JE1c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "596a0d7dc02bb847b5f4cb44a20a15ff12275bb3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-darwin": { "locked": { "lastModified": 1780030872, @@ -892,7 +886,6 @@ "root": { "inputs": { "agenix": "agenix", - "blender-bin": "blender-bin", "catppuccin": "catppuccin", "disko": "disko", "haumea": "haumea", @@ -907,6 +900,7 @@ "nixpak": "nixpak", "nixpkgs": "nixpkgs_2", "nixpkgs-2505": "nixpkgs-2505", + "nixpkgs-blender": "nixpkgs-blender", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-master": "nixpkgs-master", "nixpkgs-patched": "nixpkgs-patched", diff --git a/flake.nix b/flake.nix index 49e5d718..3c2de9e9 100644 --- a/flake.nix +++ b/flake.nix @@ -119,10 +119,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - blender-bin = { - url = "github:edolstra/nix-warez?dir=blender"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # Track Blender from master while keeping its lock entry independent from regular nixpkgs. + nixpkgs-blender.url = "github:nixos/nixpkgs/master"; nixos-apple-silicon = { url = "github:nix-community/nixos-apple-silicon"; diff --git a/home/linux/gui/base/creative.nix b/home/linux/gui/base/creative.nix index 56d31056..ded37bd9 100644 --- a/home/linux/gui/base/creative.nix +++ b/home/linux/gui/base/creative.nix @@ -3,7 +3,7 @@ pkgs, pkgs-stable, pkgs-master, - blender-bin, + pkgs-blender, ... }: { @@ -17,6 +17,7 @@ musescore # music notation pkgs-master.orca-slicer # 3d printer slicer app pkgs-master.bambu-studio # bambu 3d printer slicer app + pkgs-blender.blender # 3d modeling # reaper # audio production # sonic-pi # music programming @@ -37,9 +38,6 @@ hyphenDicts.en_GB # British English ] ++ (lib.optionals pkgs.stdenv.isx86_64 [ - # https://github.com/edolstra/nix-warez/blob/master/blender/flake.nix - blender-bin.packages.${pkgs.stdenv.hostPlatform.system}.blender_4_2 # 3d modeling - ldtk # A modern, versatile 2D level editor # fpga diff --git a/outputs/default.nix b/outputs/default.nix index 700611aa..6f8404c1 100644 --- a/outputs/default.nix +++ b/outputs/default.nix @@ -13,9 +13,15 @@ let # so that I can use them in all my nixos/home-manager/darwin modules. genSpecialArgs = system: + let + pkgs-stable = import inputs.nixpkgs-stable { + inherit system; + config.allowUnfree = true; + }; + in inputs // { - inherit mylib myvars; + inherit mylib myvars pkgs-stable; # use unstable branch for some packages to get the latest updates # pkgs-unstable = import inputs.nixpkgs-unstable { @@ -28,11 +34,6 @@ let # To use chrome, we need to allow the installation of non-free software config.allowUnfree = true; }; - pkgs-stable = import inputs.nixpkgs-stable { - inherit system; - # To use chrome, we need to allow the installation of non-free software - config.allowUnfree = true; - }; pkgs-patched = import inputs.nixpkgs-patched { inherit system; # to use chrome, we need to allow the installation of non-free software @@ -43,6 +44,23 @@ let # to use chrome, we need to allow the installation of non-free software config.allowUnfree = true; }; + pkgs-blender = import inputs.nixpkgs-blender { + inherit system; + config = lib.optionalAttrs (system == "x86_64-linux") { + allowUnfree = true; + cudaSupport = true; + # CUDA compute capability 8.9 targets the RTX 4090 (Ada) and avoids building kernels + # for unrelated GPU architectures. + cudaCapabilities = [ "8.9" ]; + }; + overlays = lib.optional (system == "x86_64-linux") ( + _: prev: { + # CMake 4.2+ breaks OIDN's nested CUDA build with nixpkgs' split CUDAToolkit_ROOT. + # https://github.com/NixOS/nixpkgs/issues/544701 + openimagedenoise = prev.openimagedenoise.override { cmake = pkgs-stable.cmake; }; + } + ); + }; pkgs-x64 = import nixpkgs { system = "x86_64-linux";