2025-06-23 17:04:59 +02:00

57 lines
1.4 KiB
Nix

{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.settings.desktop-environments.niri.swww;
in {
options = {
settings.desktop-environments.niri.swww.enable = lib.mkOption {
type = lib.types.bool;
description = ''
Enable swww wallpapers deamon
'';
default = config.settings.desktop-environments.niri.enable;
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
swww
swaybg
];
systemd.user.services.swaybg = {
Unit = {
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
Requisite = [ "graphical-session.target" ];
Description = "Enable swaybg wallpaper management";
};
Install = {
WantedBy = [ "niri.service"];
};
Service = {
ExecStart = ''${pkgs.swaybg}/bin/swaybg -m fill -i "%h/nix/assets/wallpaper-2-blurred.png"'';
Restart = ''on-failure'';
};
};
systemd.user.services.swww = {
Unit = {
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
Requisite = [ "graphical-session.target" ];
Description = "Enable swww wallpaper management";
};
Install = {
WantedBy = [ "niri.service"];
};
Service = {
ExecStart = ''${pkgs.swww}/bin/swww-daemon'';
Restart = ''on-failure'';
};
};
};
}