mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
Add options to support more flexible module configurations. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
43 lines
839 B
Nix
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;
|
|
};
|
|
};
|
|
};
|
|
}
|