logind.extraConfig doesn't seem to take effect

Hi,
My 9 month old son loves pressing the power-button on my PC and therefore constantly puts it to sleep/hibernate. (not sure which). According to Logind - NixOS Wiki and the linked Power management - ArchWiki , I expect that this snippet should do the trick

 services.logind.extraConfig = ''
    # don’t shutdown when power button is short-pressed
    HandlePowerKey=ignore
    HandleSuspendKey=ignore
    HandleHibernateKey=ignore
  '';

But that doesn’t seem to change anything. A short-press on the power button does the same as before. This is on nixos 21.05

[edit]
Gnome was overriding it. This solved it:
gsettings set org.gnome.settings-daemon.plugins.power power-button-action nothing

1 Like