summary refs log tree commit diff
path: root/nixos/modules/services/x11/display-managers
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2023-08-28 18:31:52 +0200
committerGitHub <noreply@github.com>2023-08-28 18:31:52 +0200
commit434d160d7c6305cfc5c7166d3766a6dbe5af286a (patch)
treea42b3ec3f58c877a7057f5556547481a3546f76c /nixos/modules/services/x11/display-managers
parentb07fffd56eca0614ce83df5222beaf5320b7c4ed (diff)
parent0e6827ed9c09e517d47575e1b9e19f52e0961225 (diff)
downloadnixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar.gz
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar.bz2
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar.lz
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar.xz
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.tar.zst
nixpkgs-434d160d7c6305cfc5c7166d3766a6dbe5af286a.zip
Merge pull request #234615 from linsui/dconf
nixos/dconf: support generating from attrs
Diffstat (limited to 'nixos/modules/services/x11/display-managers')
-rw-r--r--nixos/modules/services/x11/display-managers/gdm.nix40
1 files changed, 7 insertions, 33 deletions
diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix
index 676d08b93e2..e6923bcbb56 100644
--- a/nixos/modules/services/x11/display-managers/gdm.nix
+++ b/nixos/modules/services/x11/display-managers/gdm.nix
@@ -231,40 +231,14 @@ in
 
     systemd.user.services.dbus.wantedBy = [ "default.target" ];
 
-    programs.dconf.profiles.gdm =
-    let
-      customDconf = pkgs.writeTextFile {
-        name = "gdm-dconf";
-        destination = "/dconf/gdm-custom";
-        text = ''
-          ${optionalString (!cfg.gdm.autoSuspend) ''
-            [org/gnome/settings-daemon/plugins/power]
-            sleep-inactive-ac-type='nothing'
-            sleep-inactive-battery-type='nothing'
-            sleep-inactive-ac-timeout=0
-            sleep-inactive-battery-timeout=0
-          ''}
-        '';
-      };
-
-      customDconfDb = pkgs.stdenv.mkDerivation {
-        name = "gdm-dconf-db";
-        buildCommand = ''
-          ${pkgs.dconf}/bin/dconf compile $out ${customDconf}/dconf
-        '';
+    programs.dconf.profiles.gdm.databases = lib.optionals (!cfg.gdm.autoSuspend) [{
+      settings."org/gnome/settings-daemon/plugins/power" = {
+        sleep-inactive-ac-type = "nothing";
+        sleep-inactive-battery-type = "nothing";
+        sleep-inactive-ac-timeout = lib.gvariant.mkInt32 0;
+        sleep-inactive-battery-timeout = lib.gvariant.mkInt32 0;
       };
-    in pkgs.stdenv.mkDerivation {
-      name = "dconf-gdm-profile";
-      buildCommand = ''
-        # Check that the GDM profile starts with what we expect.
-        if [ $(head -n 1 ${gdm}/share/dconf/profile/gdm) != "user-db:user" ]; then
-          echo "GDM dconf profile changed, please update gdm.nix"
-          exit 1
-        fi
-        # Insert our custom DB behind it.
-        sed '2ifile-db:${customDconfDb}' ${gdm}/share/dconf/profile/gdm > $out
-      '';
-    };
+    }] ++ [ "${gdm}/share/gdm/greeter-dconf-defaults" ];
 
     # Use AutomaticLogin if delay is zero, because it's immediate.
     # Otherwise with TimedLogin with zero seconds the prompt is still