Sleep, Inactive, AC

I’ve installed NixOS on a laptop and I want to set the inactive AC timeout.

I found some references to doing it this way:

services.xserver.desktopManager.gnome = {
  enable = true;
    extraGSettingsOverridePackages = with pkgs; [ gnome3.gnome_settings_\
daemon ];
      extraGSettingsOverrides = ''
          [org.gnome.desktop.screensaver]
              lock-delay=3600
                  lock-enabled=true'

    [org.gnome.desktop.session]
        idle-delay=900

    [org.gnome.settings-daemon.plugins.power]
        power-button-action='nothing'
            idle-dim=true
                sleep-inactive-battery-type='nothing'
                    sleep-inactive-ac-timeout=3600
                        sleep-inactive-ac-type='nothing'
                            sleep-inactive-battery-timeout=1800
                              '';
                              };

, but it complains:

sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: attribute 'gnome_settings_daemon' missing

       at /etc/nixos/configuration.nix:117:51:

          116|   enable = true;
          117|     extraGSettingsOverridePackages = with pkgs; [ gnome3.gnome_settings_daemon ];
             |                                                   ^
          118|       extraGSettingsOverrides = ''
       Did you mean gnome-settings-daemon?
(use '--show-trace' to show detailed location information)

Any pointers?:wink:

Hello!

I think the correct package name is
gnome.gnome-settings-daemon

Yeah, I tried that

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

services.xserver.desktopManager.gnome = {
  enable = true;
    extraGSettingsOverridePackages = with pkgs; [ gnome.gnome_settings_d\
aemon ];
      extraGSettingsOverrides = ''
          [org.gnome.desktop.screensaver]
              lock-delay=3600
                  lock-enabled=true'

    [org.gnome.desktop.session]
        idle-delay=900

    [org.gnome.settings-daemon.plugins.power]
        power-button-action='nothing'
            idle-dim=true
                sleep-inactive-battery-type='nothing'
                    sleep-inactive-ac-timeout=3600
                        sleep-inactive-ac-type='nothing'
                            sleep-inactive-battery-timeout=1800
                              '';
                              };

, but then I get this:

sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: attribute 'gnome_settings_daemon' missing

       at /etc/nixos/configuration.nix:117:51:

          116|   enable = true;
          117|     extraGSettingsOverridePackages = with pkgs; [ gnome.gnome_settings_daemon ];
             |                                                   ^
          118|       extraGSettingsOverrides = ''
       Did you mean gnome-settings-daemon?
(use '--show-trace' to show detailed location information)

Im not sure. but can you try this.

services.xserver.desktopManager.gnome .enable = true;

services.xserver.desktopManager.gnome.extraGSettingsOverridePackages = [gnome.gnome-settings-daemon];

services.xserver.desktopManager.gnome.extraGSettingsOverrides = ''
          [org.gnome.desktop.screensaver]
              lock-delay=3600
                  lock-enabled=true'

    [org.gnome.desktop.session]
        idle-delay=900

    [org.gnome.settings-daemon.plugins.power]
        power-button-action='nothing'
            idle-dim=true
                sleep-inactive-battery-type='nothing'
                    sleep-inactive-ac-timeout=3600
                        sleep-inactive-ac-type='nothing'
                            sleep-inactive-battery-timeout=1800
                              '';

also the package is

gnome.gnome-settings-daemon

not

gnome.gnome_settings_daemon

ok, I got a little further, but then I get this;)


building '/nix/store/y0k6jw9cd7vwcanxqf74sn9lym4aj89j-gnome-gsettings-overrides.drv'...
Warning: Schema ?org.gnome.system.locale? has path ?/system/locale/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy? has path ?/system/proxy/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.http? has path ?/system/proxy/http/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.https? has path ?/system/proxy/https/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.ftp? has path ?/system/proxy/ftp/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.socks? has path ?/system/proxy/socks/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/system/? are deprecated.
/nix/store/9n2n32k0csxglsd7wgx5ixap9h8cksq3-gnome-gsettings-overrides/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/zz-nixos-defaults.gschema.override: Key file contains line “x” which is not a key-value pair, group, or comment.  --strict was specified; exiting.
error: builder for '/nix/store/y0k6jw9cd7vwcanxqf74sn9lym4aj89j-gnome-gsettings-overrides.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/ndrb93h9rrs2n9ns7ab0ygbk0iwlm7yd-etc-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3nq730153i0l3hsycc06jz24n56i2kwg-set-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/920khw656vc452dq3baixj3ywf04cj5l-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lsq4dwng3npp32rw7wkv1k009hwqcmpa-nixos-system-nixos-22.11.4256.628d4bb6e9f.drv' failed to build

Your code was missing this and an extra space, but once I added that, it ran.

Didn’t help, though, cause it still suspends after a few minutes.

I’ve read elsewhere that it might be Xorg itself causing the suspend.

Not sure how this work, but are there more than one daemon handling suspend or does GNOME settings daemon simply talk to Xorg, which contains a power daemon or how is it?:wink:

Im new to nixos myself so really not sure. but have a look in

services.logind.extraConfig

here
https://search.nixos.org/options?channel=23.05&show=services.logind.extraConfig&from=0&size=50&sort=relevance&type=packages&query=logind

as im using

services.logind.lidSwitchExternalPower = "ignore";

to prevent my laptop from suspending when lid is closed while AC is on.

Seems a restart helped, but now it doesn’t suspend at all;)