mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
This change converts redundant attribute assignments of the form `a = a;` or `a = someSet.a;` into cleaner `inherit` statements. This reduces verbosity and follows common Nix style for bringing attributes into scope. Statix Codes: W03 (manual_inherit), W04 (manual_inherit_from) Also include statix and the rule in our configuration.
44 lines
947 B
Nix
44 lines
947 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
|
|
cfg = config.programs.obs-studio;
|
|
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.adisbladis ];
|
|
|
|
options = {
|
|
programs.obs-studio = {
|
|
enable = lib.mkEnableOption "obs-studio";
|
|
|
|
package = lib.mkPackageOption pkgs "obs-studio" { };
|
|
|
|
finalPackage = lib.mkOption {
|
|
type = lib.types.package;
|
|
visible = false;
|
|
readOnly = true;
|
|
description = "Resulting customized OBS Studio package.";
|
|
};
|
|
|
|
plugins = lib.mkOption {
|
|
default = [ ];
|
|
example = lib.literalExpression "[ pkgs.obs-studio-plugins.wlrobs ]";
|
|
description = "Optional OBS plugins.";
|
|
type = lib.types.listOf lib.types.package;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home.packages = [ cfg.finalPackage ];
|
|
programs.obs-studio.finalPackage = pkgs.wrapOBS.override { obs-studio = cfg.package; } {
|
|
inherit (cfg) plugins;
|
|
};
|
|
};
|
|
}
|