Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
45
hosts/common/configs/user/gui/obs/default.nix
Normal file
45
hosts/common/configs/user/gui/obs/default.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
kernelModules = [ "v4l2loopback" ];
|
||||
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
||||
extraModprobeConfig = ''
|
||||
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
|
||||
'';
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/obs-studio" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
programs.obs-studio.enable = true;
|
||||
|
||||
xdg.configFile."obs-studio/basic/profiles/Untitled/basic.ini".source =
|
||||
(pkgs.formats.ini { }).generate "basic.ini"
|
||||
{
|
||||
SimpleOutput = {
|
||||
FilePath = "${home}/Videos";
|
||||
VBitrate = 4000;
|
||||
ABitrate = 320;
|
||||
RecEncoder = "nvenc_hevc";
|
||||
FileNameWithoutSpace = true;
|
||||
};
|
||||
Video = with hmConfig.programs.obs-studio.resolution; {
|
||||
BaseCX = base.x;
|
||||
BaseCY = base.y;
|
||||
OutputCX = output.x;
|
||||
OutputCY = output.y;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
31
hosts/common/configs/user/gui/obs/options.nix
Normal file
31
hosts/common/configs/user/gui/obs/options.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.programs.obs-studio.resolution =
|
||||
with lib;
|
||||
with types;
|
||||
{
|
||||
base = {
|
||||
x = mkOption {
|
||||
type = int;
|
||||
description = "Base resolution width.";
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = int;
|
||||
description = "Base resolution height.";
|
||||
};
|
||||
};
|
||||
|
||||
output = {
|
||||
x = mkOption {
|
||||
type = int;
|
||||
description = "Output resolution width.";
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = int;
|
||||
description = "Output resolution height.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user