I cannot disable DontZap (can't stop ctrl-alt backspace from closing all apps)

I normally use ctrl+alt+backspace as a keybind in vscode. Something is enabling this stupid keybind to run DontZap or whatever, which is something that restarts xserver and closes all of my open apps (except alacrity and the default file browser, for some reason).

I use nixpkgs 24.11 and home-manager 24.11 with a flake.nix for version locking. Here’s a snippet from my /etc/nixos/configuration.nix file.

  services.xserver = {
    enable = false;
    enableCtrlAltBackspace = false;
  };

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.displayManager.gdm.wayland = true;
  services.xserver.desktopManager.gnome.enable = true;

Yes, services.xserver.enable = false. This is one of my latest attempts to disable this piece of detritus keybind. To be honest, I don’t fully understand the relationship between xserver and gnome since I’ve enabled Wayland instead of Xorg. In any case, all I care about is stopping this keybind from costing me time and energy every time I forget about it and lose much of my recent work.

I’ve also running gsettings set org.gnome.desktop.input-sources xkb-options "[]" which works until the next reboot, in which case it reverts back to the value ['terminate:ctrl_alt_bksp'].

Sidenote: looking upservices.xserver.enableCtrlAltBackspace in man configuration.nix says it’s disabled by default so I don’t know what that’s about.

Thanks in advance. Please let me know if I should just include my whole config. Nothing else seemed relevant.

I mean, clearly it’s a GNOME keybind then, and you have to configure GNOME not to do this. It certainly isn’t a standard X server thing to my knowledge.

To make that change permanent in a declarative way you’ll have to master dconf - I’d give clearer instructions, but frankly I never used the glossy DEs in anger, I’m not a fan of confusing default behaviors either.

You’d need to set something like (completely untested, I’m just using exactly what you wrote above):

  programs.dconf.profiles.user.databases = [{
    settings."org/gnome/desktop/input-sources".xkb-options = [ ];
  }];

Not a bad idea, but there is no keybind listed in gnome’s settings. I searched restart, close, and ctrl+alt, and nothing of relevance showed.

I had tried something similar using home-manager’s dconf.settings attribute set, which worked for other settings (the move-to-workspace-left/-right ones in particular), but just like the gsettings command, the xkb-options one still resets on reboot.

I just tried your suggestion for the system options in configuration.nix, but that only changes the default value. Rebooting didn’t help or anything. There has to be some other setting that is reenabling it on startup (something like services.xserver.enableCtrlAltBackspace) or some rogue script.

  programs.dconf.profiles.user.databases = [{
    settings."org/gnome/desktop/input-sources".xkb-options = lib.gvariant.mkEmptyArray (lib.gvariant.type.string);
  }];