1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-09 18:41:06 +01:00

caffeine: add service

This commit is contained in:
Nikita Uvarov 2020-11-01 12:28:27 +01:00 committed by Robert Helgesson
parent 612afee126
commit cabf9ddd98
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{ 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 {
systemd.user.services.caffeine = {
Unit = { Description = "caffeine"; };
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
ProtectHome = "yes";
Type = "exec";
Slice = "session.slice";
ExecStart = "${pkgs.caffeine-ng}/bin/caffeine";
};
};
};
}