diff options
author | Tor Hedin Brønner <torhedinbronner@gmail.com> | 2019-01-12 08:33:05 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2019-12-15 04:16:18 +0100 |
commit | dd7144b8601958562d78f795abcab4668404d15d (patch) | |
tree | e2f2e0a620ccfa455ad701e6d1add0969d0b8eae | |
parent | d362df6682d3506e17c069f95cb39b10e516d123 (diff) |
nixos/sessionPackages: provide session names in passthru
We want access to the valid session names at evaluation time.
6 files changed, 23 insertions, 1 deletions
diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix index f5c66cbd6634..d685a5259324 100644 --- a/nixos/modules/programs/sway.nix +++ b/nixos/modules/programs/sway.nix @@ -24,6 +24,7 @@ let swayJoined = pkgs.symlinkJoin { name = "sway-joined"; paths = [ swayWrapped swayPackage ]; + passthru.providedSessions = [ "sway" ]; }; in { options.programs.sway = { diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 4a75787f715e..4dc06b30c7a5 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -263,7 +263,20 @@ in }; sessionPackages = mkOption { - type = types.listOf types.package; + type = with types; listOf (package // { + description = "package with provided sessions"; + check = p: assertMsg + (package.check p && p ? providedSessions + && p.providedSessions != [] && all isString p.providedSessions) + '' + Package, '${p.name}', did not specify any session names, as strings, in + 'passthru.providedSessions'. This is required when used as a session package. + + The session names can be looked up in: + ${p}/share/xsessions + ${p}/share/wayland-sessions + ''; + }); default = []; description = '' A list of packages containing x11 or wayland session files to be passed to the display manager. diff --git a/pkgs/desktops/gnome-3/core/gnome-session/default.nix b/pkgs/desktops/gnome-3/core/gnome-session/default.nix index 8aaf68ea1e36..d63435ce2e9a 100644 --- a/pkgs/desktops/gnome-3/core/gnome-session/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-session/default.nix @@ -55,6 +55,7 @@ stdenv.mkDerivation rec { packageName = "gnome-session"; attrPath = "gnome3.gnome-session"; }; + providedSessions = [ "gnome" "gnome-xorg" ]; }; meta = with stdenv.lib; { diff --git a/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix b/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix index 808d36dab95c..c1791ee5bbdc 100644 --- a/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix +++ b/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix @@ -141,6 +141,8 @@ let Type=Application DesktopNames=GNOME-Flashback;GNOME; ''; + } // { + providedSessions = [ "gnome-flashback-${wmName}" ]; }; mkSystemdTargetForWm = { wmName }: diff --git a/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix b/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix index ab7333212a05..07c9e724fc65 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix @@ -131,6 +131,7 @@ stdenv.mkDerivation rec { inherit repoName; attrPath = pname; }; + providedSessions = [ "pantheon" ]; }; meta = with stdenv.lib; { diff --git a/pkgs/desktops/surf-display/default.nix b/pkgs/desktops/surf-display/default.nix index 47b7e1172068..dd0644866478 100644 --- a/pkgs/desktops/surf-display/default.nix +++ b/pkgs/desktops/surf-display/default.nix @@ -43,6 +43,10 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=${placeholder "out"}" ]; + passthru = { + providedSessions = [ "surf-display" ]; + }; + meta = with stdenv.lib; { description = "Kiosk browser session manager based on the surf browser"; homepage = "https://code.it-zukunft-schule.de/cgit/surf-display/"; |