summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorOllie Charles <ollie@ocharles.org.uk>2015-11-23 14:45:26 +0000
committerOllie Charles <ollie@ocharles.org.uk>2015-11-23 14:48:56 +0000
commit52f872ec27fa9bcbcc33f7d97ac4416386316f8f (patch)
tree4eadd69394095dd7315e094ae67317c51d98b08e /nixos/modules
parentd0589b0c549d22ee7c981989a5f915b3b7d5f002 (diff)
downloadnixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar.gz
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar.bz2
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar.lz
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar.xz
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.tar.zst
nixlib-52f872ec27fa9bcbcc33f7d97ac4416386316f8f.zip
services.xserver: Disable Ctrl+Alt+Backspace by default
Ctrl+Alt+Backspace is usually enabled by default under X, and is a
keyboard shortcut that forcefully kills the current X server. This can
lead to data loss by users if accidentally pressed. This commit
introduces a new option, services.xserver.enableCtrlAltBackspace, that
is *disabled* by default. If set to true, the previous behavior can be
restored.

A similar decision was made by the Ubuntu team, and is documented here:
https://wiki.ubuntu.com/XorgCtrlAltBackspace
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/x11/xserver.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index 3348e8d0582c..fd862232e07f 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -409,6 +409,16 @@ in
           if possible.
         '';
       };
+
+      enableCtrlAltBackspace = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to enable the DontZap option, which binds Ctrl+Alt+Backspace
+          to forcefully kill X. This can lead to data loss and is disabled
+          by default.
+        '';
+      };
     };
 
   };
@@ -533,6 +543,7 @@ in
       ''
         Section "ServerFlags"
           Option "AllowMouseOpenFail" "on"
+          Option "DontZap" "${if cfg.enableCtrlAltBackspace then "off" else "on"}"
           ${cfg.serverFlagsSection}
         EndSection