nixdots/home/services/hyprpaper.nix

34 lines
857 B
Nix
Raw Normal View History

2024-06-27 20:00:11 +00:00
{
lib,
pkgs,
osConfig,
config,
...
}: let
inherit (lib) mkIf getExe;
cfg = osConfig.myOptions.home-manager.services.hyprpaper;
cfgIsWayland = osConfig.myOptions.home-manager.wms.isWayland;
in {
config = mkIf (cfg.enable && cfgIsWayland) {
systemd.user.services.hyprpaper = {
2024-07-26 23:07:07 +00:00
Install.WantedBy = ["hyprland-session.target"];
2024-06-27 20:00:11 +00:00
Unit = {
Description = "Hyprpaper (Hyprland wallpaper daemon)";
2024-07-26 23:07:07 +00:00
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
2024-06-27 20:00:11 +00:00
};
Service = {
Type = "simple";
ExecStart = "${getExe pkgs.hyprpaper}";
Restart = "on-failure";
};
};
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload=${cfg.wallpaperPath}
wallpaper=,${cfg.wallpaperPath} # same wallpaper on all monitors
ipc=off
'';
};
}