rsibreak: add module

This commit is contained in:
Jos van Bakel 2019-04-29 19:22:37 +02:00 committed by Robert Helgesson
parent f99d4ba7c4
commit be4b100ae5
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 45 additions and 0 deletions

View file

@ -1076,6 +1076,14 @@ in
support to your VSCode. support to your VSCode.
''; '';
} }
{
time = "2019-05-04T23:56:39+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.rsibreak'.
'';
}
]; ];
}; };
} }

View file

@ -112,6 +112,7 @@ let
(loadModule ./services/polybar.nix { }) (loadModule ./services/polybar.nix { })
(loadModule ./services/random-background.nix { }) (loadModule ./services/random-background.nix { })
(loadModule ./services/redshift.nix { }) (loadModule ./services/redshift.nix { })
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/screen-locker.nix { }) (loadModule ./services/screen-locker.nix { })
(loadModule ./services/stalonetray.nix { }) (loadModule ./services/stalonetray.nix { })
(loadModule ./services/status-notifier-watcher.nix { }) (loadModule ./services/status-notifier-watcher.nix { })

View file

@ -0,0 +1,36 @@
{ 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";
};
};
};
}