mirror of
https://github.com/oddlama/nixos-extra-modules.git
synced 2025-10-10 13:50:39 +02:00
31 lines
877 B
Nix
31 lines
877 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
options.xsession.windowManager.i3.enableSystemdTarget = lib.mkEnableOption "i3 autostarting the systemd graphical user targets";
|
|
config = let
|
|
cfg = config.xsession.windowManager.i3.enableSystemdTarget;
|
|
in
|
|
lib.mkIf cfg {
|
|
systemd.user = {
|
|
targets.i3-session = {
|
|
Unit = {
|
|
Description = "i3 session";
|
|
Documentation = ["man:systemd.special(7)"];
|
|
BindsTo = ["graphical-session.target"];
|
|
Wants = ["graphical-session-pre.target"];
|
|
After = ["graphical-session-pre.target"];
|
|
};
|
|
};
|
|
};
|
|
xsession.windowManager.i3.config.startup = lib.mkAfter [
|
|
{
|
|
command = "${pkgs.systemd}/bin/systemctl --user start i3-session.target";
|
|
always = false;
|
|
notification = false;
|
|
}
|
|
];
|
|
};
|
|
}
|