2019-04-29 19:22:37 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.rsibreak;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2019-04-29 19:22:37 +02:00
|
|
|
options.services.rsibreak = {
|
|
|
|
|
|
|
|
enable = mkEnableOption "rsibreak";
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.rsibreak" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2021-06-17 17:08:10 +02:00
|
|
|
home.packages = [ pkgs.rsibreak ];
|
2019-04-29 19:22:37 +02:00
|
|
|
systemd.user.services.rsibreak = {
|
|
|
|
Unit = {
|
|
|
|
Description = "RSI break timer";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2019-04-29 19:22:37 +02:00
|
|
|
|
|
|
|
Service = {
|
2024-09-19 18:15:20 +02:00
|
|
|
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
|
2019-04-29 19:22:37 +02:00
|
|
|
ExecStart = "${pkgs.rsibreak}/bin/rsibreak";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|