fork/home-manager
git clone https://git.julia.blue/fork/home-manager
5f433eb1
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . caffeine ; 8 9in { 10meta . maintainers = [ maintainers . uvnikita ]; 11 12options = { 13services . caffeine = { enable = mkEnableOption "Caffeine service" ; }; 14}; 15 16config = mkIf cfg . enable { 17assertions = [ 18( lib . hm . assertions . assertPlatform "services.caffeine" pkgs 19lib . platforms . linux ) 20]; 21 22systemd . user . services . caffeine = { 23Unit = { Description = "caffeine" ; }; 24 25Install = { WantedBy = [ "graphical-session.target" ]; }; 26 27Service = { 28Restart = "on-failure" ; 29PrivateTmp = true ; 30ProtectSystem = "full" ; 31ProtectHome = "yes" ; 32Type = "exec" ; 33Slice = "session.slice" ; 34ExecStart = " ${ pkgs . caffeine-ng } /bin/caffeine" ; 35}; 36}; 37}; 38}