aboutsummaryrefslogtreecommitdiff
path: root/modules/services/rsibreak.nix
blob: 77eaa71f958a4b3b25dedd39a57c45db43122e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.rsibreak;

in {
  options.services.rsibreak = {

    enable = mkEnableOption "rsibreak";

  };

  config = mkIf cfg.enable {
    systemd.user.services.rsibreak = {
      Unit = {
        Description = "RSI break timer";
        After = [ "graphical-session-pre.target" ];
        PartOf = [ "graphical-session.target" ];
      };

      Install = { WantedBy = [ "graphical-session.target" ]; };

      Service = {
        Environment = "PATH=${config.home.profileDirectory}/bin";
        ExecStart = "${pkgs.rsibreak}/bin/rsibreak";
      };
    };
  };
}