os/modules/headless-graphical/sway-headless.service.nix

31 lines
748 B
Nix
Raw Permalink Normal View History

2021-05-30 19:10:28 +00:00
pkgs:
{
Unit = {
2022-04-30 15:41:08 +00:00
Description = "Headless sway - SirCmpwn's Wayland window manager";
2021-05-30 19:10:28 +00:00
Documentation = [ "man:sway(5)" ];
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
2022-04-30 15:41:08 +00:00
2021-05-30 19:10:28 +00:00
Service = {
Type = "simple";
2022-04-30 15:41:08 +00:00
ExecStart = "${pkgs.sway}/bin/sway --headless";
Environment = [
"WLR_BACKENDS=headless"
"WLR_RENDERER=pixman"
"WLR_LIBINPUT_NO_DEVICES=1"
];
2021-05-30 19:10:28 +00:00
Restart = "on-failure";
RestartSec = "1";
TimeoutStopSec = "10";
ExecStopPost = "${pkgs.systemd}/bin/systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
};
2022-04-30 15:41:08 +00:00
Install = {
WantedBy = [ "sway-session.target" ];
};
2021-05-30 19:10:28 +00:00
}