summaryrefslogtreecommitdiff
path: root/modules/root/decklink.nix
blob: 035bd633698c8a6ac485d322942fcd50837aa134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ config, lib, pkgs, ... }: {
	options = {
		decklink.enable = lib.mkEnableOption "enables decklink support";
	};

	config = {
		assertions = [
			{
				assertion = config.nixpkgs.config.allowUnfree or false;
				message = "Must allow unfree pkgs to use the decklink module";
			}
		];

		# Kernel modules
		hardware.decklink.enable = true;

		# DesktopVideoHelper
		environment.systemPackages = with pkgs; [ blackmagic-desktop-video ];

		# Enable decklinkSupport flag globally for all packages that support it (e.g. obs)
		nixpkgs.overlays = [
			(final: prev: { decklinkSupport = true; })
			(final: prev: {
				blackmagic-desktop-video = (pkgs.callPackage ./software/derivations/blackmagic-desktop-video-gui/generic.nix {}).override({
					desktopVideoFull = true;
				});
			})
		];
	};
}