[remEYEnder] Add module

This commit is contained in:
Tibo De Peuter 2024-09-19 15:29:55 +02:00
parent 4c8d6dfc27
commit a113c47eac
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
3 changed files with 35 additions and 0 deletions

View file

@ -5,6 +5,7 @@
./openssh
./pipewire
./printing
./remEYEnder
./tailscale
];
}

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sisyphus.services.remEYEnder;
in {
option.sisyphus.services.remEYEnder.enable = lib.mkEnableOption "Eye reminder";
config = lib.mkIf cfg.enable {
systemd.user = {
services.remEYEnder = {
enable = true;
description = "Send an eye reminder";
serviceConfig.Type = "oneshot";
script = ''
# Display reminder for 20 seconds.
${pkgs.libnotify}/bin/notify-send -t 20000 "RemEYEnder" "Look away from your screen :)"
'';
};
timers.remEYEnder = {
enable = true;
description = "Timer for remEYEnders, runs every 20 minutes.";
wantedBy = [
"timers.target"
];
timerConfig = {
OnActiveSec = "20min";
OnUnitActiveSec = "20min";
Unit = "remEYEnder.service";
};
};
};
};
}

View file

@ -46,6 +46,7 @@ in {
sisyphus = {
programs.spotify-adblock.enable = true;
services.remEYEnder.enable = true;
};
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {