Skip to content

Instantly share code, notes, and snippets.

@peti
Created October 2, 2018 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peti/304a14130d562602c1ffa9128543bf38 to your computer and use it in GitHub Desktop.
Save peti/304a14130d562602c1ffa9128543bf38 to your computer and use it in GitHub Desktop.
Disable GDM's auto-suspension of the machine when no user is logged in
{ config, pkgs, lib, ... }: # disable-gdm-auto-suspend.nix
{
assertions = [
{ assertion = config.services.xserver.displayManager.gdm.enable;
message = "dont't include disable-gdm-auto-suspend.nix unless GDM is enabled";
}
];
programs.dconf.enable = true;
environment.etc."dconf/db/local.d/disable-auto-suspend".text = ''
[org/gnome/settings-daemon/plugins/power]
power-button-action='nothing'
sleep-inactive-battery-type='nothing'
sleep-inactive-ac-type='nothing'
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment