Problem with `xkbOptions` - it doesn't seem to take effect

Unfortunately, we only have way to set default GSettings values but since gnome-settings-daemon sets the value to one from xkb-config, the default value will not be used:

  services.xserver.desktopManager.gnome3 = {
    extraGSettingsOverridePackages = with pkgs; [ gnome3.gnome-settings-daemon ];
    extraGSettingsOverrides = ''
      # does not work
      [org.gnome.desktop.input-sources]
      sources=[('xkb', '${config.services.xserver.layout}${lib.optionalString (config.services.xserver.xkbVariant != "") "+" + config.services.xserver.xkbVariant}')]
      xkb-options=['${config.services.xserver.xkbOptions}']
    '';
  };

The proper method will be generating dconf databases (nixos/dconf: Allow creating custom databases · Issue #54150 · NixOS/nixpkgs · GitHub) but our modules cannot do that at the moment. You can either try to create dconf database yourself (see nixos/gdm: add autoSuspend option by chpatrick · Pull Request #63790 · NixOS/nixpkgs · GitHub), or use home-manager, which does have working dconf.settings option.

1 Like