nixos/programs/gnome-session: update documentation and option visibility

This commit is contained in:
Gabriel Arazas 2024-07-30 18:28:37 +08:00
parent 81dadd8699
commit 9ef3e308f9
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 14 additions and 13 deletions

View File

@ -12,16 +12,7 @@ let
# at <https://docs.gtk.org/glib/struct.KeyFile.html> for details about the
# keyfile formatting and possibly the Desktop Entry specification at
# <https://freedesktop.org/wiki/Specifications/desktop-entry-spec>.
glibKeyfileFormat = pkgs.formats.ini {
listsAsDuplicateKeys = false;
mkKeyValue = lib.generators.mkKeyValueDefault {
mkValueString = v:
if lib.isList v then
lib.concatStringsSep ";" v
else
lib.generators.mkValueStringDefault { } v;
} "=";
} // {
glibKeyfileFormat = {
type = with lib.types;
let
valueType = oneOf [
@ -31,10 +22,14 @@ let
str
(listOf valueType)
] // {
description = "GLib keyfile atom (null, bool, int, float, string, or a list of the previous atoms)";
description = "GLib keyfile atom (bool, int, float, string, or a list of the previous atoms)";
};
in
attrsOf (attrsOf valueType);
generate = name: value:
pkgs.callPackage ({ writeText }:
writeText name (lib.generators.toDconfINI value));
};
# The bulk of the work. Pretty much the main purpose of this module.
@ -43,7 +38,8 @@ let
let
gnomeSession = glibKeyfileFormat.generate "session-${session.name}" session.settings;
# For now, we set this as a
# For now, we set this as a static template since there's not much
# things to configure especially for a desktop session anyways.
displaySession = ''
[Desktop Entry]
Name=${session.fullName}
@ -53,6 +49,8 @@ let
DesktopNames=${lib.concatStringsSep ";" session.desktopNames}
'';
# Similarly to the desktop session template, this is also set as a
# static template.
sessionScript = ''
#!${pkgs.runtimeShell}

View File

@ -14,6 +14,7 @@ let
`restartTriggers`.
:::
'';
visible = "shallow";
default = null;
};
in

View File

@ -123,7 +123,7 @@ in
extraArgs = lib.mkOption {
type = with lib.types; listOf str;
description = ''
A list of arguments from {program}`gnome-session` to be added for the session
A list of arguments from {command}`gnome-session` to be added for the session
script.
::: {.note}
@ -145,6 +145,7 @@ in
Generally, you won't need to set this since the module will set the
common settings such as the `RequiredComponents=` key.
'';
default = { };
example = lib.literalExpression ''
{
"GNOME Session" = {
@ -211,6 +212,7 @@ in
`reloadTriggers` and `restartTriggers`.
:::
'';
visible = "shallow";
defaultText = ''
{
wants = ... # All of the required components as a target unit.