diff options
author | Anders Papitto <anderspapitto@gmail.com> | 2015-03-08 20:04:33 -0700 |
---|---|---|
committer | Anders Papitto <anderspapitto@gmail.com> | 2015-03-08 20:12:18 -0700 |
commit | 887a547ac903e3f628fb3984aef9c3354afbeba8 (patch) | |
tree | 1f858a4bfd6f693ed4857cf7693f9b2353b5655b /nixos/modules/services/x11/unclutter.nix | |
parent | a869c8351cfcd6ec42147e7f1c8f4f14ac20e587 (diff) | |
download | nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar.gz nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar.bz2 nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar.lz nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar.xz nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.tar.zst nixpkgs-887a547ac903e3f628fb3984aef9c3354afbeba8.zip |
Add x11 service for unclutter
modeled after the redshift service
Diffstat (limited to 'nixos/modules/services/x11/unclutter.nix')
-rw-r--r-- | nixos/modules/services/x11/unclutter.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/unclutter.nix b/nixos/modules/services/x11/unclutter.nix new file mode 100644 index 00000000000..556d9e187fd --- /dev/null +++ b/nixos/modules/services/x11/unclutter.nix @@ -0,0 +1,33 @@ +{ 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"; + type = types.uniq types.string; + }; + }; + + 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"; + }; + }; +} |