mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
programs/gnome-session: update comments
This commit is contained in:
parent
f592c5b8ef
commit
67b3c96869
@ -68,6 +68,11 @@ let
|
|||||||
This has the same options as {option}`systemd.user.services.<name>`
|
This has the same options as {option}`systemd.user.services.<name>`
|
||||||
but without certain options from stage 2 counterparts such as
|
but without certain options from stage 2 counterparts such as
|
||||||
`reloadTriggers` and `restartTriggers`.
|
`reloadTriggers` and `restartTriggers`.
|
||||||
|
|
||||||
|
On a typical case, you shouldn't mess with much of the dependency
|
||||||
|
ordering of the service unit. By default, this module sets the
|
||||||
|
service unit as part of the respective target unit (i.e.,
|
||||||
|
`PartOf=$COMPONENTID.target`).
|
||||||
:::
|
:::
|
||||||
'';
|
'';
|
||||||
default = {};
|
default = {};
|
||||||
@ -91,6 +96,9 @@ let
|
|||||||
This has the same options as {option}`systemd.user.targets.<name>`
|
This has the same options as {option}`systemd.user.targets.<name>`
|
||||||
but without certain options from stage 2 counterparts such as
|
but without certain options from stage 2 counterparts such as
|
||||||
`reloadTriggers` and `restartTriggers`.
|
`reloadTriggers` and `restartTriggers`.
|
||||||
|
|
||||||
|
This module doesn't set the typical dependency ordering relative to
|
||||||
|
gnome-session targets. This is on the user to manually set them.
|
||||||
:::
|
:::
|
||||||
'';
|
'';
|
||||||
default = {};
|
default = {};
|
||||||
@ -121,7 +129,7 @@ let
|
|||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = ''
|
description = ''
|
||||||
A package containing the desktop item set with
|
A package containing the desktop item set with
|
||||||
{option}`desktopSessions.gnome-session.sessions.<name>.components.<name>.desktopConfig`.
|
{option}`$SESSION.components.<name>.desktopConfig`.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -129,7 +137,8 @@ let
|
|||||||
config = {
|
config = {
|
||||||
id = "${session.name}.${name}";
|
id = "${session.name}.${name}";
|
||||||
|
|
||||||
# Make with the default configurations.
|
# Make with the default configurations for the built-in-managed
|
||||||
|
# components.
|
||||||
desktopConfig = {
|
desktopConfig = {
|
||||||
name = lib.mkForce config.id;
|
name = lib.mkForce config.id;
|
||||||
desktopName = lib.mkDefault "${session.fullName} - ${config.description}";
|
desktopName = lib.mkDefault "${session.fullName} - ${config.description}";
|
||||||
@ -144,14 +153,41 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Setting some recommendation and requirements for systemd-managed
|
/*
|
||||||
# gnome-session components.
|
Setting some recommendation and requirements for systemd-managed
|
||||||
|
gnome-session components. Note there are the missing directives that
|
||||||
|
COULD include some sane defaults here.
|
||||||
|
|
||||||
|
* The `Unit.OnFailure=` and `Unit.OnFailureJobMode=` directives. Since
|
||||||
|
different components don't have the same priority and don't handle
|
||||||
|
failures the same way, we didn't set it here. This is on the user to
|
||||||
|
know how different desktop components interact with each other
|
||||||
|
especially if one of them failed.
|
||||||
|
|
||||||
|
TODO: Is `Type=notify` a good default?
|
||||||
|
* `Service.Type=` is obviously not included since not all desktop
|
||||||
|
components are the same either. Some of them could a D-Bus service,
|
||||||
|
some of them are oneshots, etc. Not to mention, this is already implied
|
||||||
|
to be `Type=simple` by systemd anyways.
|
||||||
|
|
||||||
|
* `Service.OOMScoreAdjust=` have different values for different
|
||||||
|
components so it isn't included.
|
||||||
|
|
||||||
|
As you can tell, this module does not provide a framework for the user
|
||||||
|
to easily compose their own desktop environment. THIS MODULE ALREADY
|
||||||
|
DOES A LOT, ALRIGHT! CUT ME SOME SLACK!
|
||||||
|
*/
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
script = lib.mkAfter "${config.scriptPackage}/bin/${session.name}-${name}-script";
|
script = lib.mkAfter "${config.scriptPackage}/bin/${session.name}-${name}-script";
|
||||||
description = lib.mkDefault config.description;
|
description = lib.mkDefault config.description;
|
||||||
|
|
||||||
|
# The typical workflow for service units to have them set as part of
|
||||||
|
# the respective target unit.
|
||||||
|
requisite = [ "${config.id}.target" ];
|
||||||
before = [ "${config.id}.target" ];
|
before = [ "${config.id}.target" ];
|
||||||
partOf = [ "${config.id}.target" ];
|
partOf = [ "${config.id}.target" ];
|
||||||
|
|
||||||
|
# Some sane service configuration for a desktop component.
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Slice = lib.mkDefault "session.slice";
|
Slice = lib.mkDefault "session.slice";
|
||||||
Restart = lib.mkDefault "on-failure";
|
Restart = lib.mkDefault "on-failure";
|
||||||
@ -170,6 +206,16 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Similarly, there are things that COULD make it here but didn't for a
|
||||||
|
variety of reasons.
|
||||||
|
|
||||||
|
* `Unit.PartOf=`, `Unit.Requisite=`, and the like since some components
|
||||||
|
require starting up earlier than the others. We could include it here
|
||||||
|
if we make it clear in the documentation or if it proves to be a
|
||||||
|
painful experience to configure this by a first-timer. For now, this is
|
||||||
|
on the user to know.
|
||||||
|
*/
|
||||||
targetConfig = {
|
targetConfig = {
|
||||||
wants = [ "${config.id}.service" ];
|
wants = [ "${config.id}.service" ];
|
||||||
description = lib.mkDefault config.description;
|
description = lib.mkDefault config.description;
|
||||||
@ -369,6 +415,7 @@ let
|
|||||||
Comment=${config.description}
|
Comment=${config.description}
|
||||||
Exec=@out@/libexec/${name}-session
|
Exec=@out@/libexec/${name}-session
|
||||||
Type=Application
|
Type=Application
|
||||||
|
DesktopNames=${config.fullName};
|
||||||
'';
|
'';
|
||||||
|
|
||||||
sessionScript = ''
|
sessionScript = ''
|
||||||
@ -451,14 +498,18 @@ in
|
|||||||
|
|
||||||
Each of the attribute name will be used as the identifier of the
|
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
|
desktop environment. While you can make identifiers in any way, it is
|
||||||
encouraged to follow a reverse DNS-like scheme (e.g.,
|
encouraged to stick to a naming scheme. Here's two common ways to name
|
||||||
`com.example.MoseyBranch`).
|
a desktop environment.
|
||||||
|
|
||||||
|
* Reverse DNS-like scheme (e.g., `com.example.MoseyBranch`).
|
||||||
|
* Kebab-case (e.g., `mosey-branch`).
|
||||||
'';
|
'';
|
||||||
default = { };
|
default = { };
|
||||||
example = lib.literalExpression ''
|
example = lib.literalExpression ''
|
||||||
{
|
{
|
||||||
"one.foodogsquared.SimpleWay" = {
|
"one.foodogsquared.SimpleWay" = {
|
||||||
components = {
|
components = {
|
||||||
|
# This unit is intended to start with gnome-session.
|
||||||
window-manager = {
|
window-manager = {
|
||||||
script = '''
|
script = '''
|
||||||
''${lib.getExe' config.programs.sway.package "sway"}
|
''${lib.getExe' config.programs.sway.package "sway"}
|
||||||
|
Loading…
Reference in New Issue
Block a user