46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   pkgs,
 | |
|   lib,
 | |
|   osConfig,
 | |
|   ...
 | |
| }:
 | |
| let
 | |
|   withCuda = osConfig.system.name == "gunter";
 | |
| 
 | |
|   onnxruntime-gpu = (pkgs.onnxruntime.override { cudaSupport = withCuda; });
 | |
| 
 | |
|   obs-backgrounremoval-gpu = (
 | |
|     (pkgs.obs-studio-plugins.obs-backgroundremoval.override { onnxruntime = onnxruntime-gpu; })
 | |
|     .overrideAttrs
 | |
|       (old: {
 | |
|         version = "1.1.14-beta";
 | |
|         src = pkgs.fetchFromGitHub {
 | |
|           owner = "occ-ai";
 | |
|           repo = "obs-backgroundremoval";
 | |
|           rev = "012a7f45fe4cb5363abee654d05c5cba4235feb5";
 | |
|           hash = "sha256-ud9RfnbMXfOaIhkUYG7zyR4SxZhj3rZd9b4+8P4jBYs=";
 | |
|         };
 | |
|         cmakeFlags =
 | |
|           if withCuda then
 | |
|             (lib.lists.remove "-DDISABLE_ONNXRUNTIME_GPU=ON" old.cmakeFlags)
 | |
|           else
 | |
|             old.cmakeFlags;
 | |
|       })
 | |
|   );
 | |
| in
 | |
| {
 | |
|   programs.obs-studio = {
 | |
|     enable = true;
 | |
|     package = pkgs.obs-studio.override {
 | |
|       cudaSupport = withCuda;
 | |
|     };
 | |
|     plugins =
 | |
|       with pkgs.obs-studio-plugins;
 | |
|       [
 | |
|         obs-pipewire-audio-capture
 | |
|         obs-shaderfilter
 | |
|       ]
 | |
|       ++ lib.optionals withCuda [ obs-backgrounremoval-gpu ];
 | |
|   };
 | |
| }
 |