summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-07-01 20:09:24 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-07-01 20:09:24 +0100
commit6250cb03ef08c989fdcc0edccafe2a222b6a159e (patch)
treeeef951bf2e092e25813c7100ae5a249537c66ceb
parent20d330276d1618e5c58e53eda03d25e58e042b2b (diff)
add eth.hardware.touchpad module
-rw-r--r--nixos/modules/hardware/touchpad.nix24
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 25 insertions, 0 deletions
diff --git a/nixos/modules/hardware/touchpad.nix b/nixos/modules/hardware/touchpad.nix
new file mode 100644
index 0000000..30b57b9
--- /dev/null
+++ b/nixos/modules/hardware/touchpad.nix
@@ -0,0 +1,24 @@
+{ config, lib, pkgs, ... }:
+with lib;
+
+let
+ cfg = config.eth.hardware.touchpad;
+
+in {
+ options.eth.hardware.touchpad = {
+ enable = mkEnableOption "Enable the touchpad.";
+
+ naturalScrolling = mkOption {
+ type = types.bool;
+ description = "The good scrolling.";
+ default = false;
+ };
+ };
+
+ config = mkIf cfg.enable {
+ services.xserver.libinput = {
+ enable = true;
+ naturalScrolling = cfg.naturalScrolling;
+ };
+ };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 92b2cf6..9b29135 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -1,6 +1,7 @@
[
./hardware/keyboard.nix
./hardware/linode.nix
+ ./hardware/touchpad.nix
./hardware/yubikey.nix
./location.nix
./nix.nix