refactor(niri,xwayland-satellite): split out xwayland-satellite
Some checks failed
build / build (push) Has been cancelled

해결 #5
This commit is contained in:
2026-03-31 13:57:46 -06:00
parent 5dc4d57d7e
commit 87a8280e51
3 changed files with 46 additions and 18 deletions

View File

@@ -9,14 +9,6 @@ in {
type = lib.types.nullOr lib.types.path;
default = config.stylix.image;
};
# xwayland-satellite implements rootless Xwayland in a separate application,
# without the host compositor's involvement. It makes X11 windows appear as
# normal windows, just like a native Xwayland integration. While it is still
# somewhat experimental, it handles a lot of applications correctly, like
# Steam, games and Discord.
xwayland-satellite.enable =
lib.mkEnableOption "xwayland-satellite starting with Niri"
// { default = true; };
polkit.enable =
lib.mkEnableOption "Niri/Gnome Polkit" // { default = true; };
swaylock.enable =
@@ -67,26 +59,17 @@ in {
stylix.targets.swaylock.enable = cfg.swaylock.enable;
services.polkit-gnome.enable = cfg.polkit.enable;
sydnix.xwayland-satellite.enable = lib.mkDefault true;
# File-picker.
home.packages = [ pkgs.nautilus ];
systemd.user.services.xwayland-satellite =
lib.mkIf cfg.xwayland-satellite.enable {
Service.ExecStart =
["${pkgs.xwayland-satellite}/bin/xwayland-satellite"];
Unit.After = ["niri.service"];
Unit.PartOf = ["niri.service"];
Install.WantedBy = ["niri.service"];
};
programs.niri = {
settings = {
# Activates some Nixpkgs patches to help run Electron applications under
# Wayland.
environment = {
NIXOS_OZONE_WL = "1";
DISPLAY = ":0";
XDG_CURRENT_DESKTOP = "niri";
QT_QPA_PLATFORM = "wayland";
ELECTRON_OZONE_PLATFORM_HINT = "auto";

View File

@@ -0,0 +1,38 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.xwayland-satellite;
in {
options.sydnix.xwayland-satellite = {
# xwayland-satellite implements rootless Xwayland in a separate
# application, without the host compositor's involvement. It makes
# X11 windows appear as normal windows, just like a native
# Xwayland integration. While it is still somewhat experimental,
# it handles a lot of applications correctly, like Steam, games
# and Discord.
enable = lib.mkEnableOption "XWayland outside your Wayland";
};
config = lib.mkIf cfg.enable {
systemd.user.services.xwayland-satellite =
let xwayland-satellite =
pkgs.xwayland-satellite.override { withSystemd = true; };
in {
Unit = {
Description = "Xwayland outside your Wayland";
BindsTo = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
Requisite = [ "graphical-session.target" ];
};
Service = {
Type = "notify";
NotifyAccess = "all";
ExecStart = lib.getExe xwayland-satellite;
StandardOutput = "journal";
ExecStartPost = "systemctl --user set-environment DISPLAY=:0";
ExecStop = "systemctl --user unset-environment DISPLAY";
};
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

View File

@@ -12,6 +12,13 @@ in {
enableDynamicTheming = false;
};
# Start after xwayland-satellite, if possible. So DMS can start
# with the DISPLAY env var set.
systemd.user.services.dms = {
wants = ["xwayland-satellite.service"];
after = ["xwayland-satellite.service"];
};
services.displayManager.dms-greeter = {
enable = true;
compositor.name = assert config.sydnix.niri.enable; "niri";