diff options
Diffstat (limited to 'nixos/modules/services/x11')
13 files changed, 15 insertions, 306 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/budgie.nix b/nixos/modules/services/x11/desktop-managers/budgie.nix index 75ee82f1f948..b4e739029335 100644 --- a/nixos/modules/services/x11/desktop-managers/budgie.nix +++ b/nixos/modules/services/x11/desktop-managers/budgie.nix @@ -214,7 +214,7 @@ in { services.geoclue2.enable = mkDefault true; # for BCC's Privacy > Location Services panel. services.upower.enable = config.powerManagement.enable; # for Budgie's Status Indicator and BCC's Power panel. - services.xserver.libinput.enable = mkDefault true; # for BCC's Mouse panel. + services.libinput.enable = mkDefault true; # for BCC's Mouse panel. services.colord.enable = mkDefault true; # for BCC's Color panel. services.gnome.at-spi2-core.enable = mkDefault true; # for BCC's A11y panel. services.accounts-daemon.enable = mkDefault true; # for BCC's Users panel. diff --git a/nixos/modules/services/x11/desktop-managers/cinnamon.nix b/nixos/modules/services/x11/desktop-managers/cinnamon.nix index 8c29b41c8cf8..482527d1e8ad 100644 --- a/nixos/modules/services/x11/desktop-managers/cinnamon.nix +++ b/nixos/modules/services/x11/desktop-managers/cinnamon.nix @@ -116,7 +116,7 @@ in services.touchegg.enable = mkDefault true; services.udisks2.enable = true; services.upower.enable = mkDefault config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; services.xserver.updateDbusEnvironment = true; networking.networkmanager.enable = mkDefault true; diff --git a/nixos/modules/services/x11/desktop-managers/deepin.nix b/nixos/modules/services/x11/desktop-managers/deepin.nix index 680ce7b9a93e..30bd14adb419 100644 --- a/nixos/modules/services/x11/desktop-managers/deepin.nix +++ b/nixos/modules/services/x11/desktop-managers/deepin.nix @@ -61,7 +61,7 @@ in services.gnome.gnome-keyring.enable = mkDefault true; services.bamf.enable = mkDefault true; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; services.udisks2.enable = true; services.upower.enable = mkDefault config.powerManagement.enable; networking.networkmanager.enable = mkDefault true; diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index 09f90e1cd4df..0a341ba133d3 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -96,7 +96,7 @@ in services.udisks2.enable = true; services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; services.dbus.packages = [ e.efl ]; diff --git a/nixos/modules/services/x11/desktop-managers/gnome.nix b/nixos/modules/services/x11/desktop-managers/gnome.nix index 95c79cf96108..a0cf56e7a920 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome.nix @@ -339,7 +339,7 @@ in # services.packagekit.enable = mkDefault true; services.udisks2.enable = true; services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center + services.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center # Explicitly enabled since GNOME will be severely broken without these. xdg.mime.enable = true; diff --git a/nixos/modules/services/x11/desktop-managers/lxqt.nix b/nixos/modules/services/x11/desktop-managers/lxqt.nix index 1937bdcbd3e7..ac86c385bcc8 100644 --- a/nixos/modules/services/x11/desktop-managers/lxqt.nix +++ b/nixos/modules/services/x11/desktop-managers/lxqt.nix @@ -69,7 +69,7 @@ in services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; xdg.portal.lxqt.enable = mkDefault true; diff --git a/nixos/modules/services/x11/desktop-managers/mate.nix b/nixos/modules/services/x11/desktop-managers/mate.nix index 520d40d67908..beae07b70dbf 100644 --- a/nixos/modules/services/x11/desktop-managers/mate.nix +++ b/nixos/modules/services/x11/desktop-managers/mate.nix @@ -88,7 +88,7 @@ in services.udev.packages = [ pkgs.mate.mate-settings-daemon ]; services.gvfs.enable = true; services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; security.pam.services.mate-screensaver.unixAuth = true; diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 57ccbaccb0c6..008bc65eb6a4 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -159,7 +159,7 @@ in services.gsignond.plugins = with pkgs.gsignondPlugins; [ lastfm mail oauth ]; services.udisks2.enable = true; services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; services.xserver.updateDbusEnvironment = true; services.zeitgeist.enable = mkDefault true; services.geoclue2.enable = mkDefault true; diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 56fcd70dc951..7d80b9b2641c 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -348,7 +348,7 @@ in services.system-config-printer.enable = mkIf config.services.printing.enable (mkDefault true); services.udisks2.enable = true; services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; + services.libinput.enable = mkDefault true; # Extra UDEV rules used by Solid services.udev.packages = [ diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix index c55d0021b6a7..85d0d199de3f 100644 --- a/nixos/modules/services/x11/desktop-managers/xfce.nix +++ b/nixos/modules/services/x11/desktop-managers/xfce.nix @@ -164,7 +164,7 @@ in services.gvfs.enable = true; services.tumbler.enable = true; services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); - services.xserver.libinput.enable = mkDefault true; # used in xfce4-settings-manager + services.libinput.enable = mkDefault true; # used in xfce4-settings-manager # Enable default programs programs.dconf.enable = true; diff --git a/nixos/modules/services/x11/hardware/cmt.nix b/nixos/modules/services/x11/hardware/cmt.nix index 55d3d840ee09..53906c5c716f 100644 --- a/nixos/modules/services/x11/hardware/cmt.nix +++ b/nixos/modules/services/x11/hardware/cmt.nix @@ -46,10 +46,10 @@ in { assertions = [ { - assertion = !config.services.xserver.libinput.enable; + assertion = !config.services.libinput.enable; message = '' cmt and libinput are incompatible, meaning you cannot enable them both. - To use cmt you need to disable libinput with `services.xserver.libinput.enable = false` + To use cmt you need to disable libinput with `services.libinput.enable = false` If you haven't enabled it in configuration.nix, it's enabled by default on a different xserver module. ''; diff --git a/nixos/modules/services/x11/hardware/libinput.nix b/nixos/modules/services/x11/hardware/libinput.nix deleted file mode 100644 index 54ff7d85a033..000000000000 --- a/nixos/modules/services/x11/hardware/libinput.nix +++ /dev/null @@ -1,291 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let cfg = config.services.xserver.libinput; - - xorgBool = v: if v then "on" else "off"; - - mkConfigForDevice = deviceType: { - dev = mkOption { - type = types.nullOr types.str; - default = null; - example = "/dev/input/event0"; - description = '' - Path for ${deviceType} device. Set to `null` to apply to any - auto-detected ${deviceType}. - ''; - }; - - accelProfile = mkOption { - type = types.enum [ "flat" "adaptive" ]; - default = "adaptive"; - example = "flat"; - description = '' - Sets the pointer acceleration profile to the given profile. - Permitted values are `adaptive`, `flat`. - Not all devices support this option or all profiles. - If a profile is unsupported, the default profile for this is used. - `flat`: Pointer motion is accelerated by a constant - (device-specific) factor, depending on the current speed. - `adaptive`: Pointer acceleration depends on the input speed. - This is the default profile for most devices. - ''; - }; - - accelSpeed = mkOption { - type = types.nullOr types.str; - default = null; - example = "-0.5"; - description = "Cursor acceleration (how fast speed increases from minSpeed to maxSpeed)."; - }; - - buttonMapping = mkOption { - type = types.nullOr types.str; - default = null; - example = "1 6 3 4 5 0 7"; - description = '' - Sets the logical button mapping for this device, see XSetPointerMapping(3). The string must - be a space-separated list of button mappings in the order of the logical buttons on the - device, starting with button 1. The default mapping is "1 2 3 ... 32". A mapping of 0 deac‐ - tivates the button. Multiple buttons can have the same mapping. Invalid mapping strings are - discarded and the default mapping is used for all buttons. Buttons not specified in the - user's mapping use the default mapping. See section BUTTON MAPPING for more details. - ''; - }; - - calibrationMatrix = mkOption { - type = types.nullOr types.str; - default = null; - example = "0.5 0 0 0 0.8 0.1 0 0 1"; - description = '' - A string of 9 space-separated floating point numbers. Sets the calibration matrix to the - 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). - ''; - }; - - clickMethod = mkOption { - type = types.nullOr (types.enum [ "none" "buttonareas" "clickfinger" ]); - default = null; - example = "buttonareas"; - description = '' - Enables a click method. Permitted values are `none`, - `buttonareas`, `clickfinger`. - Not all devices support all methods, if an option is unsupported, - the default click method for this device is used. - ''; - }; - - leftHanded = mkOption { - type = types.bool; - default = false; - description = "Enables left-handed button orientation, i.e. swapping left and right buttons."; - }; - - middleEmulation = mkOption { - type = types.bool; - default = true; - description = '' - Enables middle button emulation. When enabled, pressing the left and right buttons - simultaneously produces a middle mouse button click. - ''; - }; - - naturalScrolling = mkOption { - type = types.bool; - default = false; - description = "Enables or disables natural scrolling behavior."; - }; - - scrollButton = mkOption { - type = types.nullOr types.int; - default = null; - example = 1; - description = '' - Designates a button as scroll button. If the ScrollMethod is button and the button is logically - held down, x/y axis movement is converted into scroll events. - ''; - }; - - scrollMethod = mkOption { - type = types.enum [ "twofinger" "edge" "button" "none" ]; - default = "twofinger"; - example = "edge"; - description = '' - Specify the scrolling method: `twofinger`, `edge`, - `button`, or `none` - ''; - }; - - horizontalScrolling = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables horizontal scrolling. When disabled, this driver will discard any - horizontal scroll events from libinput. This does not disable horizontal scroll events - from libinput; it merely discards the horizontal axis from any scroll events. - ''; - }; - - sendEventsMode = mkOption { - type = types.enum [ "disabled" "enabled" "disabled-on-external-mouse" ]; - default = "enabled"; - example = "disabled"; - description = '' - Sets the send events mode to `disabled`, `enabled`, - or `disabled-on-external-mouse` - ''; - }; - - tapping = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables tap-to-click behavior. - ''; - }; - - tappingButtonMap = mkOption { - type = types.nullOr (types.enum [ "lrm" "lmr" ]); - default = null; - description = '' - Set the button mapping for 1/2/3-finger taps to left/right/middle or left/middle/right, respectively. - ''; - }; - - tappingDragLock = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables drag lock during tapping behavior. When enabled, a finger up during tap- - and-drag will not immediately release the button. If the finger is set down again within the - timeout, the dragging process continues. - ''; - }; - - transformationMatrix = mkOption { - type = types.nullOr types.str; - default = null; - example = "0.5 0 0 0 0.8 0.1 0 0 1"; - description = '' - A string of 9 space-separated floating point numbers. Sets the transformation matrix to - the 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). - ''; - }; - - disableWhileTyping = mkOption { - type = types.bool; - default = false; - description = '' - Disable input method while typing. - ''; - }; - - additionalOptions = mkOption { - type = types.lines; - default = ""; - example = - '' - Option "DragLockButtons" "L1 B1 L2 B2" - ''; - description = '' - Additional options for libinput ${deviceType} driver. See - {manpage}`libinput(4)` - for available options."; - ''; - }; - }; - - mkX11ConfigForDevice = deviceType: matchIs: '' - Identifier "libinput ${deviceType} configuration" - MatchDriver "libinput" - MatchIs${matchIs} "${xorgBool true}" - ${optionalString (cfg.${deviceType}.dev != null) ''MatchDevicePath "${cfg.${deviceType}.dev}"''} - Option "AccelProfile" "${cfg.${deviceType}.accelProfile}" - ${optionalString (cfg.${deviceType}.accelSpeed != null) ''Option "AccelSpeed" "${cfg.${deviceType}.accelSpeed}"''} - ${optionalString (cfg.${deviceType}.buttonMapping != null) ''Option "ButtonMapping" "${cfg.${deviceType}.buttonMapping}"''} - ${optionalString (cfg.${deviceType}.calibrationMatrix != null) ''Option "CalibrationMatrix" "${cfg.${deviceType}.calibrationMatrix}"''} - ${optionalString (cfg.${deviceType}.transformationMatrix != null) ''Option "TransformationMatrix" "${cfg.${deviceType}.transformationMatrix}"''} - ${optionalString (cfg.${deviceType}.clickMethod != null) ''Option "ClickMethod" "${cfg.${deviceType}.clickMethod}"''} - Option "LeftHanded" "${xorgBool cfg.${deviceType}.leftHanded}" - Option "MiddleEmulation" "${xorgBool cfg.${deviceType}.middleEmulation}" - Option "NaturalScrolling" "${xorgBool cfg.${deviceType}.naturalScrolling}" - ${optionalString (cfg.${deviceType}.scrollButton != null) ''Option "ScrollButton" "${toString cfg.${deviceType}.scrollButton}"''} - Option "ScrollMethod" "${cfg.${deviceType}.scrollMethod}" - Option "HorizontalScrolling" "${xorgBool cfg.${deviceType}.horizontalScrolling}" - Option "SendEventsMode" "${cfg.${deviceType}.sendEventsMode}" - Option "Tapping" "${xorgBool cfg.${deviceType}.tapping}" - ${optionalString (cfg.${deviceType}.tappingButtonMap != null) ''Option "TappingButtonMap" "${cfg.${deviceType}.tappingButtonMap}"''} - Option "TappingDragLock" "${xorgBool cfg.${deviceType}.tappingDragLock}" - Option "DisableWhileTyping" "${xorgBool cfg.${deviceType}.disableWhileTyping}" - ${cfg.${deviceType}.additionalOptions} - ''; -in { - - imports = - (map (option: mkRenamedOptionModule ([ "services" "xserver" "libinput" option ]) [ "services" "xserver" "libinput" "touchpad" option ]) [ - "accelProfile" - "accelSpeed" - "buttonMapping" - "calibrationMatrix" - "clickMethod" - "leftHanded" - "middleEmulation" - "naturalScrolling" - "scrollButton" - "scrollMethod" - "horizontalScrolling" - "sendEventsMode" - "tapping" - "tappingButtonMap" - "tappingDragLock" - "transformationMatrix" - "disableWhileTyping" - "additionalOptions" - ]); - - options = { - - services.xserver.libinput = { - enable = mkEnableOption "libinput" // { - default = config.services.xserver.enable; - defaultText = lib.literalExpression "config.services.xserver.enable"; - }; - mouse = mkConfigForDevice "mouse"; - touchpad = mkConfigForDevice "touchpad"; - }; - }; - - - config = mkIf cfg.enable { - - services.xserver.modules = [ pkgs.xorg.xf86inputlibinput ]; - - environment.systemPackages = [ pkgs.xorg.xf86inputlibinput ]; - - environment.etc = - let cfgPath = "X11/xorg.conf.d/40-libinput.conf"; - in { - ${cfgPath} = { - source = pkgs.xorg.xf86inputlibinput.out + "/share/" + cfgPath; - }; - }; - - services.udev.packages = [ pkgs.libinput.out ]; - - services.xserver.inputClassSections = [ - (mkX11ConfigForDevice "mouse" "Pointer") - (mkX11ConfigForDevice "touchpad" "Touchpad") - ]; - - assertions = [ - # already present in synaptics.nix - /* { - assertion = !config.services.xserver.synaptics.enable; - message = "Synaptics and libinput are incompatible, you cannot enable both (in services.xserver)."; - } */ - ]; - - }; - -} diff --git a/nixos/modules/services/x11/hardware/synaptics.nix b/nixos/modules/services/x11/hardware/synaptics.nix index 4dfa917d8fb4..c43fdac6b1ec 100644 --- a/nixos/modules/services/x11/hardware/synaptics.nix +++ b/nixos/modules/services/x11/hardware/synaptics.nix @@ -30,7 +30,7 @@ in { enable = mkOption { type = types.bool; default = false; - description = "Whether to enable touchpad support. Deprecated: Consider services.xserver.libinput.enable."; + description = "Whether to enable touchpad support. Deprecated: Consider services.libinput.enable."; }; dev = mkOption { @@ -207,8 +207,8 @@ in { assertions = [ { - assertion = !config.services.xserver.libinput.enable; - message = "Synaptics and libinput are incompatible, you cannot enable both (in services.xserver)."; + assertion = !config.services.libinput.enable; + message = "Synaptics and libinput are incompatible, you cannot enable both."; } ]; |