mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
sway: add wayland.windowManager.sway.systemd.dbusImplementation (#7271)
Allows the user to choose the dbus implementation for the environment import. See https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments
This commit is contained in:
@@ -393,7 +393,12 @@ let
|
||||
|
||||
variables = concatStringsSep " " cfg.systemd.variables;
|
||||
extraCommands = concatStringsSep " && " cfg.systemd.extraCommands;
|
||||
systemdActivation = ''exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"'';
|
||||
systemdActivation =
|
||||
{
|
||||
broker = ''exec "systemctl --user import-environment ${variables}; ${extraCommands}"'';
|
||||
dbus = ''exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"'';
|
||||
}
|
||||
.${cfg.systemd.dbusImplementation};
|
||||
|
||||
configFile = pkgs.writeTextFile {
|
||||
name = "sway.conf";
|
||||
@@ -556,6 +561,23 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
dbusImplementation = mkOption {
|
||||
type = types.enum [
|
||||
"dbus"
|
||||
"broker"
|
||||
];
|
||||
default = "dbus";
|
||||
example = "broker";
|
||||
description = ''
|
||||
The D-Bus implementation used on the system.
|
||||
This affects which tool is used to import environment variables when starting the Sway session.
|
||||
On NixOS, this should match the value of the option [`services.dbus.implementation` (NixOS)](https://nixos.org/manual/nixos/stable/options#opt-services.dbus.implementation).
|
||||
When set to `dbus`, `dbus-update-activation-environment --systemd <variables>` is run.
|
||||
Otherwise, when set to `broker`, `systemctl --user import-environment <variables>` is run.
|
||||
See <https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments> for more documentation.
|
||||
'';
|
||||
};
|
||||
|
||||
extraCommands = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
|
||||
Reference in New Issue
Block a user