Gnome power button behavior when session is locked

I have the following setting in my Gnome image settings:


However this setting doesn’t change anything for the behavior of the power button on the login screen - when my session is locked. I found this promising Arch Wiki suggestion:

# /etc/dconf/db/gdm.d/05-power

But I’m not sure, what is the NixOS equivalent of that /etc/dconf/db/gdm.d/ directory? These available settings, linked by the services.xserver.displayManager.gdm.settings option documentation, don’t mention the dconf settings mentioned in the Arch Wiki article.

You can do that with the dconf NixOS module. See gdm.nix for an example.

Thanks a lot! It was exactly what I was looking for. I was worried a bit that overriding that adding something to the programs.dconf.profiles.gdm.databases would wipe out previous additions to this list, but it turned out to be OK. For reference, here’s what I added:

    # By default, in GDM's lock screen the power button does nothing. This
    # fixes this behavior to match the behavior of the desktop environment
    programs.dconf.profiles.gdm.databases = [{
      settings."org/gnome/settings-daemon/plugins/power" = {
        power-button-action = "suspend";