diff --git a/nix/homes/x86_64-linux/sab@nz/default.nix b/nix/homes/x86_64-linux/sab@nz/default.nix index 2559b42..374ef53 100644 --- a/nix/homes/x86_64-linux/sab@nz/default.nix +++ b/nix/homes/x86_64-linux/sab@nz/default.nix @@ -28,6 +28,11 @@ in { hyprlock = disabled; wezterm = enabled; wallpaper = "${wallpapers}/share/wallpapers/catppuccin/bench.png"; + + waypaper = { + enable = true; + wallpaperDirectory = "${wallpapers}/share/wallpapers"; + }; }; }; diff --git a/nix/modules/home/desktop/addons/waypaper/default.nix b/nix/modules/home/desktop/addons/waypaper/default.nix new file mode 100644 index 0000000..684f869 --- /dev/null +++ b/nix/modules/home/desktop/addons/waypaper/default.nix @@ -0,0 +1,56 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit + (lib) + mkEnableOption + mkIf + mkOption + types + ; + + cfg = config.custom.desktop.addons.waypaper; +in { + options.custom.desktop.addons.waypaper = { + enable = mkEnableOption "Waypaper app to change wallpapers"; + wallpaperDirectory = mkOption { + type = with types; either path str; + default = config.xdg.userDirs.pictures; + apply = toString; # Prevent copies to Nix store. + description = '' + The directory where waypaper reads wallpapers from. + + If [](#opt-xdg.userDirs.enable) is + `true` then the defined XDG pictures directory is used. + Otherwise, you must explicitly specify a value. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + custom.waypaper + ]; + xdg.configFile."waypaper/config.ini".text = '' + [Settings] + language = en + folder = ${cfg.wallpaperDirectory} + backend = hyprpaper + monitors = All + fill = Fill + sort = name + color = #ffffff + subfolders = True + number_of_columns = 3 + post_command = + wallpaper = ${cfg.wallpaperDirectory}/catpuccin/lantern.png + swww_transition_type = any + swww_transition_step = 90 + swww_transition_angle = 0 + swww_transition_duration = 1 + ''; + }; +} diff --git a/nix/modules/nixos/desktop/addons/hyprland-utils/default.nix b/nix/modules/nixos/desktop/addons/hyprland-utils/default.nix index 0d8770e..eb6fd5a 100644 --- a/nix/modules/nixos/desktop/addons/hyprland-utils/default.nix +++ b/nix/modules/nixos/desktop/addons/hyprland-utils/default.nix @@ -39,8 +39,6 @@ in { adwaita-qt6 adwaita-icon-theme gnome-tweaks - # inputs.nixpkgs-philippheuer.packages.${pkgs.system}.waypaper # wallpaper manager - pkgs.custom.waypaper ]; environment.sessionVariables = { diff --git a/nix/packages/waypaper/default.nix b/nix/packages/waypaper/default.nix index c95076e..9a59683 100644 --- a/nix/packages/waypaper/default.nix +++ b/nix/packages/waypaper/default.nix @@ -43,9 +43,10 @@ python3.pkgs.buildPythonApplication rec { changelog = "https://github.com/anufrievroman/waypaper/releases/tag/${version}"; description = "GUI wallpaper setter for Wayland-based window managers"; longDescription = '' - GUI wallpaper setter for Wayland-based window managers that works as a frontend for popular backends like swaybg and swww. + GUI wallpaper setter for Wayland-based window managers that works as a + frontend for popular backends like hyprpaper, swaybg and swww. - If wallpaper does not change, make sure that swaybg or swww is installed. + If wallpaper does not change, make sure that IPC is enabled; ''; homepage = "https://github.com/anufrievroman/waypaper"; license = licenses.gpl3Only;