diff --git a/home/services/default.nix b/home/services/default.nix index 9799edc..fa9f89a 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,5 +1,6 @@ _: { imports = [ ./dunst.nix + ./hyprpaper.nix ]; } diff --git a/home/services/hyprpaper.nix b/home/services/hyprpaper.nix new file mode 100644 index 0000000..aad3a6a --- /dev/null +++ b/home/services/hyprpaper.nix @@ -0,0 +1,34 @@ +{ + 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 = { + Install.WantedBy = [ "hyprland-session.target" ]; + Unit = { + Description = "Hyprpaper (Hyprland wallpaper daemon)"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + 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 + ''; + }; +} + diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index 02ffe20..891e996 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -217,6 +217,12 @@ services = { dunst.enable = true; + hyprpaper = { + enable = true; + # This file intentionally lacks a file extension, it should be a symlink + # to whatever file you wish to actually be your wallpaper + wallpaperPath = "/data/Data/Media/Pictures/Wallpapers/active"; + }; }; }; }; diff --git a/options/home/services.nix b/options/home/services.nix index 7586b0a..bd2ec2c 100644 --- a/options/home/services.nix +++ b/options/home/services.nix @@ -4,6 +4,14 @@ in { options.myOptions.home-manager.services = { dunst.enable = mkEnableOption "Dunst (lightweight notification daemon)"; + hyprpaper = { + enable = mkEnableOption "Hyprpaper (Hyprland wallpaper daemon)"; + wallpaperPath = mkOption { + type = types.path; + default = null; + description = "Path to the wallpaper of your choosing"; + }; + }; }; }