2.home-manager/modules/programs/mpvpaper/default.nix
Austin Horstman 4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

61 lines
1.3 KiB
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
types
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.mpvpaper;
in
{
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
options.programs.mpvpaper = {
enable = mkEnableOption "mpvpaper";
package = mkPackageOption pkgs "mpvpaper" { nullable = true; };
pauseList = mkOption {
type = types.lines;
default = "";
example = ''
firefox
steam
obs
'';
description = ''
List of program names that will cause mpvpaper to pause.
Programs must be separed by spaces or newlines.
'';
};
stopList = mkOption {
type = types.lines;
default = "";
example = ''
firefox
steam
obs
'';
description = ''
List of program names that will cause mpvpaper to stop.
Programs must be separed by spaces or newlines.
'';
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.mpvpaper" pkgs lib.platforms.linux)
];
home.packages = mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."mpvpaper/pauselist".text = mkIf (cfg.pauseList != "") cfg.pauseList;
xdg.configFile."mpvpaper/stoplist".text = mkIf (cfg.stopList != "") cfg.stopList;
};
}