nixos/home/programs/obs-studio/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-28 17:44:52 +00:00
{
pkgs,
lib,
osConfig,
...
}:
let
2024-07-15 23:40:36 +00:00
withCuda = osConfig.system.name == "gunter";
2024-05-28 17:44:52 +00:00
onnxruntime-gpu = (pkgs.onnxruntime.override { cudaSupport = withCuda; }).overrideAttrs (old: {
2024-07-15 23:40:36 +00:00
# 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-05-28 17:44:52 +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";
2024-11-03 21:35:48 +00:00
rev = "012a7f45fe4cb5363abee654d05c5cba4235feb5";
hash = "sha256-ud9RfnbMXfOaIhkUYG7zyR4SxZhj3rZd9b4+8P4jBYs=";
2024-05-28 17:44:52 +00:00
};
cmakeFlags =
if withCuda then
(lib.lists.remove "-DDISABLE_ONNXRUNTIME_GPU=ON" old.cmakeFlags)
else
old.cmakeFlags;
})
);
in
2024-03-13 10:52:27 +00:00
{
2024-03-05 00:22:53 +00:00
programs.obs-studio = {
enable = true;
plugins =
with pkgs.obs-studio-plugins;
[
2024-04-02 08:23:24 +00:00
obs-pipewire-audio-capture
2024-04-03 09:56:38 +00:00
obs-shaderfilter
]
++ lib.optionals withCuda [ obs-backgrounremoval-gpu ];
2024-03-05 00:22:53 +00:00
};
}