2024-07-17 20:22:04 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
osConfig,
|
|
|
|
...
|
|
|
|
}:
|
2024-05-28 17:44:52 +00:00
|
|
|
let
|
2024-07-15 23:40:36 +00:00
|
|
|
withCuda = osConfig.system.name == "gunter";
|
2024-07-15 13:25:06 +00:00
|
|
|
|
2024-07-17 20:22:04 +00:00
|
|
|
onnxruntime-gpu = (pkgs.onnxruntime.override { cudaSupport = withCuda; }).overrideAttrs (old: {
|
|
|
|
# TODO: Remove when fixed in nixpkgs
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/onnxruntime/default.nix#L154
|
|
|
|
buildInputs = old.buildInputs ++ [ pkgs.cudaPackages.nccl ];
|
|
|
|
});
|
2024-07-15 13:25:06 +00:00
|
|
|
|
2024-07-17 20:22:04 +00:00
|
|
|
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 = "94be8c35fe077be93a6f5ef347a802295a36dddd";
|
|
|
|
hash = "sha256-qnxDNeTWQYiRMqT6jNp8GC8ef6aaAAY+OXAak54dVc8=";
|
|
|
|
};
|
|
|
|
cmakeFlags =
|
|
|
|
if withCuda then
|
|
|
|
(lib.lists.remove "-DDISABLE_ONNXRUNTIME_GPU=ON" old.cmakeFlags)
|
|
|
|
else
|
|
|
|
old.cmakeFlags;
|
|
|
|
})
|
|
|
|
);
|
2024-05-28 17:44:52 +00:00
|
|
|
in
|
2024-03-13 10:52:27 +00:00
|
|
|
{
|
2024-03-05 00:22:53 +00:00
|
|
|
programs.obs-studio = {
|
|
|
|
enable = true;
|
2024-07-17 20:22:04 +00:00
|
|
|
plugins =
|
|
|
|
with pkgs.obs-studio-plugins;
|
|
|
|
[
|
|
|
|
obs-pipewire-audio-capture
|
|
|
|
obs-shaderfilter
|
|
|
|
]
|
|
|
|
++ lib.optionals withCuda [ obs-backgrounremoval-gpu ];
|
2024-03-05 00:22:53 +00:00
|
|
|
};
|
|
|
|
}
|