1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 09:01:04 +01:00
home-manager/modules/services/caffeine.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

48 lines
807 B
Nix

{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.caffeine;
in
{
meta.maintainers = [ maintainers.uvnikita ];
options = {
services.caffeine = {
enable = mkEnableOption "Caffeine service";
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.caffeine" pkgs lib.platforms.linux)
];
systemd.user.services.caffeine = {
Unit = {
Description = "caffeine";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Type = "exec";
Slice = "session.slice";
ExecStart = "${pkgs.caffeine-ng}/bin/caffeine";
};
};
};
}