1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 07:31:03 +01:00

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'.
This commit is contained in:
Aguirre Matteo 2025-04-28 16:49:19 +00:00 committed by GitHub
parent c54a8ab0d2
commit d0d9d0a145
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,61 @@
{
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;
};
}