[remEYEnder] Add module
This commit is contained in:
parent
4c8d6dfc27
commit
a113c47eac
3 changed files with 35 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
./openssh
|
||||
./pipewire
|
||||
./printing
|
||||
./remEYEnder
|
||||
./tailscale
|
||||
];
|
||||
}
|
||||
|
|
33
nixos/modules/services/remEYEnder/default.nix
Normal file
33
nixos/modules/services/remEYEnder/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue