From 0b46826cb3654c592496a902c6599c7e6939b3d5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 2 Jan 2024 16:20:29 +0800 Subject: [PATCH] programs/gnome-session: change `componentsType.desktopConfig` type to composite type `lib.types.attrs` does not have good merging step for priority values so we changed it to `attrsOf anything`. --- .../nixos/programs/gnome-session/default.nix | 43 ++++++++----------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index 492ed8e5..a0be19e9 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -22,7 +22,7 @@ let }; desktopConfig = lib.mkOption { - type = lib.types.attrs; + type = with lib.types; attrsOf anything; description = '' The configuration for the gnome-session desktop file. For more information, look into `makeDesktopItem` nixpkgs builder. @@ -100,6 +100,21 @@ let config = { id = "${session.prefix}.${name}"; + # Make with the default configurations. + desktopConfig = { + name = lib.mkForce config.id; + desktopName = lib.mkDefault "${session.fullName} - ${config.description}"; + exec = lib.mkForce config.scriptPackage; + noDisplay = lib.mkForce true; + onlyShowIn = [ "X-${session.fullName}" ]; + extraConfig = { + X-GNOME-AutoRestart = lib.mkDefault "false"; + X-GNOME-Autostart-Notify = lib.mkDefault "true"; + X-GNOME-Autostart-Phase = lib.mkDefault "Application"; + X-GNOME-HiddenUnderSystemd = lib.mkDefault "true"; + }; + }; + # Setting some recommendation and requirements for systemd-managed # gnome-session components. serviceConfig = { @@ -147,31 +162,7 @@ let ''; }; - desktopPackage = - let - defaultDesktopConfig = config.desktopConfig // { - name = config.id; - desktopName = "${session.fullName} - ${config.description}"; - exec = config.scriptPackage; - noDisplay = true; - onlyShowIn = [ "X-${session.fullName}" ]; - }; - - # Basically, more default desktop configuration. - applicableDesktopConfig = { - # More information can be found in gnome-session(1) manual page. - extraConfig = { - X-GNOME-AutoRestart = "false"; - X-GNOME-Autostart-Notify = "true"; - X-GNOME-Autostart-Phase = "Application"; - X-GNOME-HiddenUnderSystemd = "true"; - }; - }; - in - pkgs.makeDesktopItem - (lib.attrsets.recursiveUpdate - applicableDesktopConfig - defaultDesktopConfig); + desktopPackage = pkgs.makeDesktopItem config.desktopConfig; }; };