at 15.09-beta 895 B view raw
1{ config, lib, pkgs, ... }: 2with lib; 3let cfg = config.services.unclutter; 4in { 5 options = { 6 services.unclutter.enable = mkOption { 7 type = types.bool; 8 default = false; 9 example = true; 10 description = "Enable unclutter to hide your mouse cursor when inactive"; 11 }; 12 13 services.unclutter.arguments = mkOption { 14 description = "Arguments to pass to unclutter command"; 15 default = "-idle 1"; 16 type = types.str; 17 }; 18 }; 19 20 config = mkIf cfg.enable { 21 systemd.services.unclutter = { 22 description = "unclutter"; 23 requires = [ "display-manager.service" ]; 24 after = [ "display-manager.service" ]; 25 wantedBy = [ "graphical.target" ]; 26 serviceConfig.ExecStart = '' 27 ${pkgs.unclutter}/bin/unclutter ${cfg.arguments} 28 ''; 29 environment = { DISPLAY = ":0"; }; 30 serviceConfig.Restart = "always"; 31 }; 32 }; 33}