mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
systemd: fully deprecate legacy switcher
This switches `systemd.user.startServices = true` to be the same as `systemd.user.startServices = "sd-switch"`, previously it would use the "legacy" method. It also introduces a warning that triggers if the user explicitly have `systemd.user.startServices = "legacy"`. See #5452
This commit is contained in:
parent
25c12f0736
commit
b18f3ebc40
1 changed files with 13 additions and 9 deletions
|
@ -183,7 +183,7 @@ in {
|
||||||
default = "suggest";
|
default = "suggest";
|
||||||
type = with types;
|
type = with types;
|
||||||
either bool (enum [ "suggest" "legacy" "sd-switch" ]);
|
either bool (enum [ "suggest" "legacy" "sd-switch" ]);
|
||||||
apply = p: if isBool p then if p then "legacy" else "suggest" else p;
|
apply = p: if isBool p then if p then "sd-switch" else "suggest" else p;
|
||||||
description = ''
|
description = ''
|
||||||
Whether new or changed services that are wanted by active targets
|
Whether new or changed services that are wanted by active targets
|
||||||
should be started. Additionally, stop obsolete services from the
|
should be started. Additionally, stop obsolete services from the
|
||||||
|
@ -196,17 +196,15 @@ in {
|
||||||
{command}`systemctl` commands to run. You will have to
|
{command}`systemctl` commands to run. You will have to
|
||||||
manually run those commands after the switch.
|
manually run those commands after the switch.
|
||||||
|
|
||||||
`legacy` (or `true`)
|
`legacy`
|
||||||
: Use a Ruby script to, in a more robust fashion, determine the
|
: Use a Ruby script to, in a more robust fashion, determine the
|
||||||
necessary changes and automatically run the
|
necessary changes and automatically run the
|
||||||
{command}`systemctl` commands.
|
{command}`systemctl` commands. Note, this alternative will soon
|
||||||
|
be removed.
|
||||||
|
|
||||||
`sd-switch`
|
`sd-switch` (or `true`)
|
||||||
: Use sd-switch, a third party application, to perform the service
|
: Use sd-switch, a tool that determines the necessary changes and
|
||||||
updates. This tool offers more features while having a small
|
automatically apply them.
|
||||||
closure size. Note, it requires a fully functional user D-Bus
|
|
||||||
session. Once tested and deemed sufficiently robust, this will
|
|
||||||
become the default.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,6 +297,12 @@ in {
|
||||||
message = "This module is only available on Linux.";
|
message = "This module is only available on Linux.";
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
warnings = lib.optional (cfg.startServices == "legacy") ''
|
||||||
|
Having 'systemd.user.startServices = "legacy"' is deprecated and will soon be removed.
|
||||||
|
|
||||||
|
Please change to 'systemd.user.startServices = true' to use the new systemd unit switcher (sd-switch).
|
||||||
|
'';
|
||||||
|
|
||||||
xdg.configFile = mkMerge [
|
xdg.configFile = mkMerge [
|
||||||
(lib.listToAttrs ((buildServices "service" cfg.services)
|
(lib.listToAttrs ((buildServices "service" cfg.services)
|
||||||
++ (buildServices "slice" cfg.slices)
|
++ (buildServices "slice" cfg.slices)
|
||||||
|
|
Loading…
Reference in a new issue