1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-30 14:11:02 +01:00
home-manager/modules/programs/mpvpaper.nix
Aguirre Matteo d0d9d0a145
mpvpaper: add module (#6926)
Provides a module for configuring mpvpaper a video wallpaper program for wlroots based wayland compositors. It provides options for setting the 'pauselist' and 'stoplist'.
2025-04-28 11:49:19 -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;
};
}