refactor(niri,xwayland-satellite): split out xwayland-satellite #23
@@ -9,14 +9,6 @@ in {
|
|||||||
type = lib.types.nullOr lib.types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
default = config.stylix.image;
|
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 =
|
polkit.enable =
|
||||||
lib.mkEnableOption "Niri/Gnome Polkit" // { default = true; };
|
lib.mkEnableOption "Niri/Gnome Polkit" // { default = true; };
|
||||||
swaylock.enable =
|
swaylock.enable =
|
||||||
@@ -67,26 +59,17 @@ in {
|
|||||||
stylix.targets.swaylock.enable = cfg.swaylock.enable;
|
stylix.targets.swaylock.enable = cfg.swaylock.enable;
|
||||||
|
|
||||||
services.polkit-gnome.enable = cfg.polkit.enable;
|
services.polkit-gnome.enable = cfg.polkit.enable;
|
||||||
|
sydnix.xwayland-satellite.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# File-picker.
|
# File-picker.
|
||||||
home.packages = [ pkgs.nautilus ];
|
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 = {
|
programs.niri = {
|
||||||
settings = {
|
settings = {
|
||||||
# Activates some Nixpkgs patches to help run Electron applications under
|
# Activates some Nixpkgs patches to help run Electron applications under
|
||||||
# Wayland.
|
# Wayland.
|
||||||
environment = {
|
environment = {
|
||||||
NIXOS_OZONE_WL = "1";
|
NIXOS_OZONE_WL = "1";
|
||||||
DISPLAY = ":0";
|
|
||||||
XDG_CURRENT_DESKTOP = "niri";
|
XDG_CURRENT_DESKTOP = "niri";
|
||||||
QT_QPA_PLATFORM = "wayland";
|
QT_QPA_PLATFORM = "wayland";
|
||||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||||
|
|||||||
38
modules/home/xwayland-satellite.nix
Normal file
38
modules/home/xwayland-satellite.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -12,6 +12,13 @@ in {
|
|||||||
enableDynamicTheming = false;
|
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 = {
|
services.displayManager.dms-greeter = {
|
||||||
enable = true;
|
enable = true;
|
||||||
compositor.name = assert config.sydnix.niri.enable; "niri";
|
compositor.name = assert config.sydnix.niri.enable; "niri";
|
||||||
|
|||||||
Reference in New Issue
Block a user