1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/services/rsibreak.nix
Austin Horstman 03fdb31290
treewide: add missing package options (#7575)
Add options to support more flexible module configurations.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-29 12:20:22 -05:00

43 lines
839 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.rsibreak;
in
{
options.services.rsibreak = {
enable = lib.mkEnableOption "rsibreak";
package = lib.mkPackageOption pkgs "rsibreak" { };
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.rsibreak" pkgs lib.platforms.linux)
];
home.packages = [ cfg.package ];
systemd.user.services.rsibreak = {
Unit = {
Description = "RSI break timer";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Environment = [ "PATH=${config.home.profileDirectory}/bin" ];
ExecStart = lib.getExe cfg.package;
};
};
};
}