summary refs log tree commit diff
path: root/nixos/modules/services/x11
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-03-11 15:32:40 +0100
committerlethalman <lucabru@src.gnome.org>2015-03-11 15:32:40 +0100
commitc8ac0697721e937da3c59df91049558590f3a5aa (patch)
tree2b26037c50165b688534d8b77a222f9bcb25bc43 /nixos/modules/services/x11
parentde8e22ad222fcf7c4877be4555e8d485c73a48fb (diff)
parent887a547ac903e3f628fb3984aef9c3354afbeba8 (diff)
downloadnixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar.gz
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar.bz2
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar.lz
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar.xz
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.tar.zst
nixlib-c8ac0697721e937da3c59df91049558590f3a5aa.zip
Merge pull request #6724 from anderspapitto/local
Add x11 service for unclutter
Diffstat (limited to 'nixos/modules/services/x11')
-rw-r--r--nixos/modules/services/x11/unclutter.nix33
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 000000000000..556d9e187fdd
--- /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";
+    };
+  };
+}