Reorganize imports

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-21 23:32:29 +02:00
parent 0ae56e6e25
commit 98ce774210
189 changed files with 253 additions and 260 deletions

View 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;
};
};
};
}

View 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.";
};
};
};
}