1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 10:19:39 +01:00
home-manager/modules/programs/mpvpaper.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -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;
};
}