From 51d123f6677b285afa9e40af3f97709cc8de03a0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 4 Jan 2024 17:31:40 +0800 Subject: [PATCH] programs/gnome-session: fix and refactor executable location for built-in managed sessions --- modules/nixos/programs/gnome-session/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/nixos/programs/gnome-session/default.nix b/modules/nixos/programs/gnome-session/default.nix index cd501d23..135ea49f 100644 --- a/modules/nixos/programs/gnome-session/default.nix +++ b/modules/nixos/programs/gnome-session/default.nix @@ -206,7 +206,11 @@ let }; }; - config = { + config = let + scriptName = "${session.name}-${name}-script"; + script = "${config.scriptPackage}/bin/${scriptName}"; + in + { id = "${session.name}.${name}"; # Make with the default configurations for the built-in-managed @@ -214,7 +218,7 @@ let desktopConfig = { name = lib.mkForce config.id; desktopName = lib.mkDefault "${session.fullName} - ${config.description}"; - exec = lib.mkForce config.scriptPackage; + exec = lib.mkForce script; noDisplay = lib.mkForce true; onlyShowIn = [ "X-${session.fullName}" ]; extraConfig = { @@ -250,7 +254,7 @@ let DOES A LOT, ALRIGHT! CUT ME SOME SLACK! */ serviceUnit = { - script = lib.mkAfter "${config.scriptPackage}/bin/${session.name}-${name}-script"; + script = lib.mkAfter script; description = lib.mkDefault config.description; # The typical workflow for service units to have them set as part of @@ -299,7 +303,7 @@ let }; scriptPackage = pkgs.writeShellApplication { - name = "${session.name}-${name}-script"; + name = scriptName; runtimeInputs = [ cfg.package pkgs.dbus ]; text = '' DESKTOP_AUTOSTART_ID="''${DESKTOP_AUTOSTART_ID:-}"