2025-01-25 05:44:26 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.alqueva.programs.swaybg;
|
|
|
|
inherit (lib) types;
|
|
|
|
in {
|
|
|
|
options.alqueva.programs.swaybg = {
|
|
|
|
enable = lib.mkEnableOption "swaybg";
|
|
|
|
package = lib.mkPackageOption pkgs "swaybg" {};
|
|
|
|
wallpaper = lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
description = "The wallpaper you want to use with swaybg.";
|
|
|
|
type = types.oneOf [types.str types.package types.path];
|
|
|
|
};
|
|
|
|
mode = lib.mkOption {
|
|
|
|
default = "fill";
|
|
|
|
description = "How you want the wallpaper to be displayed.";
|
|
|
|
type = types.str;
|
|
|
|
};
|
|
|
|
extraServiceConfig = {
|
|
|
|
default = {};
|
|
|
|
description = "Extra settings you want to apply to the systemd service.";
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
systemd.user.services.swaybg = {
|
|
|
|
inherit (cfg.package.meta) description;
|
|
|
|
|
|
|
|
wantedBy = ["graphical-session.target"];
|
|
|
|
after = ["graphical-session-pre.target"];
|
|
|
|
partOf = ["graphical-session.target"];
|
|
|
|
|
|
|
|
serviceConfig = {
|
2025-01-30 01:15:23 +00:00
|
|
|
ExecStart = "${lib.getExe' cfg.package "swaybg"} -i ${cfg.wallpaper} -m ${cfg.mode}";
|
2025-01-25 05:44:26 +00:00
|
|
|
Restart = "always";
|
|
|
|
RestartSec = "5";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|