programs/gnome-session: remove session prefix option

Pretty useless and will make for a confusing step in the future. We can
just make use of the attribute name already which we could nudge the
user with some recommended practice or something.
This commit is contained in:
Gabriel Arazas 2024-01-02 20:26:36 +08:00
parent 6cd1d0baa1
commit f592c5b8ef
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -102,7 +102,7 @@ let
The identifier of the component used in generating filenames for its
`.desktop` files and as part of systemd unit names.
'';
defaultText = "\${session.name}.\${name}";
defaultText = "\${session-name}.\${name}";
readOnly = true;
};
@ -127,7 +127,7 @@ let
};
config = {
id = "${session.prefix}.${name}";
id = "${session.name}.${name}";
# Make with the default configurations.
desktopConfig = {
@ -147,7 +147,7 @@ let
# Setting some recommendation and requirements for systemd-managed
# gnome-session components.
serviceConfig = {
script = lib.mkAfter "${config.scriptPackage}/bin/${session.prefix}-${name}-script";
script = lib.mkAfter "${config.scriptPackage}/bin/${session.name}-${name}-script";
description = lib.mkDefault config.description;
before = [ "${config.id}.target" ];
partOf = [ "${config.id}.target" ];
@ -181,7 +181,7 @@ let
};
scriptPackage = pkgs.writeShellApplication {
name = "${session.prefix}-${name}-script";
name = "${session.name}-${name}-script";
runtimeInputs = [ cfg.package pkgs.dbus ];
text = ''
DESKTOP_AUTOSTART_ID="''${DESKTOP_AUTOSTART_ID:-}"
@ -210,15 +210,6 @@ let
example = "Mosey Branch";
};
prefix = lib.mkOption {
type = lib.types.str;
description = ''
The identifier of the desktop environment. While it can be in any
style, it is encouraged to use a reverse DNS-like scheme.
'';
example = "com.example.MoseyBranch";
};
description = lib.mkOption {
type = lib.types.str;
description = ''
@ -232,7 +223,7 @@ let
components = lib.mkOption {
type = with lib.types; attrsOf (submoduleWith {
specialArgs.session = {
inherit (config) fullName prefix description;
inherit (config) fullName description;
inherit name;
};
modules = [ componentsType ];
@ -457,12 +448,16 @@ in
{manpage}`gnome-session(1)`. This gnome-session configuration generates
both the `.desktop` file and systemd units to be able to support both
the built-in and the systemd-managed GNOME session.
Each of the attribute name will be used as the identifier of the
desktop environment. While you can make identifiers in any way, it is
encouraged to follow a reverse DNS-like scheme (e.g.,
`com.example.MoseyBranch`).
'';
default = { };
example = lib.literalExpression ''
{
simple-way = {
prefix = "one.foodogsquared.SimpleWay";
"one.foodogsquared.SimpleWay" = {
components = {
window-manager = {
script = '''