nixos/home/david/modules/programs/waypaper.nix

44 lines
918 B
Nix
Raw Normal View History

{
lib,
config,
pkgs,
...
}: let
2025-07-01 23:17:40 +08:00
cfg = config.david.programs.waypaper;
in {
options = {
2025-07-01 23:17:40 +08:00
david.programs.waypaper = {
enable = lib.mkEnableOption "waypaper";
};
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [waypaper socat mpvpaper];
systemd.user = {
timers."waypaper" = {
Unit = {
Description = "Set a random wallpaper every 10 minutes";
};
Timer = {
Persistent = true;
OnCalendar = "*:0/10";
};
Install = {
WantedBy = ["timers.target"];
};
};
services."waypaper" = {
Unit = {
Description = "Set a random wallpaper with waypaper";
};
Service = {
Type = "oneshot";
ExecStart = lib.escapeShellArgs [
(lib.getExe pkgs.waypaper)
"--random"
];
};
};
};
};
}