26 lines
583 B
Nix
26 lines
583 B
Nix
{ lib, config, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.my.services.wallpaper;
|
|
in
|
|
{
|
|
options.my.services.wallpaper = {
|
|
enable = mkEnableOption "wallpaper changer";
|
|
frequency = mkOption {
|
|
type = types.str;
|
|
default = "30m";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.user.services.wallpaper = {
|
|
script = "${getExe config.my.programs.wallpaper.package} -r -v";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
serviceConfig = {
|
|
Restart = "always";
|
|
RuntimeMaxSec = cfg.frequency;
|
|
ExitType = "cgroup";
|
|
};
|
|
};
|
|
};
|
|
}
|