feat: support new monitor

This commit is contained in:
Moritz Böhme 2023-09-22 10:14:12 +02:00
parent b234bdbd06
commit 271cbb359b
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
6 changed files with 139 additions and 58 deletions

View file

@ -0,0 +1,26 @@
{ 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";
};
};
};
}