2015-03-09 03:04:33 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.unclutter;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
services.unclutter.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable unclutter to hide your mouse cursor when inactive";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.unclutter.arguments = mkOption {
|
|
|
|
description = "Arguments to pass to unclutter command";
|
|
|
|
default = "-idle 1";
|
2015-06-15 15:42:55 +00:00
|
|
|
type = types.str;
|
2015-03-09 03:04:33 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.unclutter = {
|
|
|
|
description = "unclutter";
|
|
|
|
requires = [ "display-manager.service" ];
|
|
|
|
after = [ "display-manager.service" ];
|
|
|
|
wantedBy = [ "graphical.target" ];
|
|
|
|
serviceConfig.ExecStart = ''
|
|
|
|
${pkgs.unclutter}/bin/unclutter ${cfg.arguments}
|
|
|
|
'';
|
|
|
|
environment = { DISPLAY = ":0"; };
|
|
|
|
serviceConfig.Restart = "always";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|