feat: add xwayland-satellite
Niri doesn't come with xwayland support, so we provide
xwayland-satellite to have native-like X windows in wayland
There is a bug with this and xwayland 24 which means that steam big
picture mode cannot display. Unfortunately, there is a bug in xwayland
23 which causes some games to be unable to launch
You also need to disable "Enable GPU accelerated rendering in web
views", which thankfully you can do with this patch (as the settings are
not a webview)
Change-Id: I6c1d417e433abda269cfb08b210c55ae688af2b0
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/717
Tested-by: Skyler Grey <minion@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/home/git/default.nix b/modules/home/git/default.nix
index ecbb140..63a12da 100644
--- a/modules/home/git/default.nix
+++ b/modules/home/git/default.nix
@@ -115,12 +115,13 @@
programs.git = {
enable = true;
- delta = {
- enable = config.chimera.git.delta.enable;
- options.light = lib.mkIf config.chimera.theme.catppuccin.enable (
- config.chimera.theme.catppuccin.style == "Latte"
- );
- };
+ delta = lib.mkIf config.chimera.git.delta.enable (lib.warn "Delta is currently disabled due to the build being broken in upstream nixpkgs" {});
+ # {
+ # enable = config.chimera.git.delta.enable;
+ # options.light = lib.mkIf config.chimera.theme.catppuccin.enable (
+ # config.chimera.theme.catppuccin.style == "Latte"
+ # );
+ # };
extraConfig = {
init.defaultBranch = "main";
diff --git a/modules/home/users/minion/default.nix b/modules/home/users/minion/default.nix
index 4ec136d..5260535 100644
--- a/modules/home/users/minion/default.nix
+++ b/modules/home/users/minion/default.nix
@@ -20,7 +20,6 @@
chimera.shell.rebuildFlakePath = "/home/${config.home.username}/Code/chimera/config";
home.packages = [
- pkgs.logseq
];
programs.git.includes =
diff --git a/modules/home/wayland/niri/default.nix b/modules/home/wayland/niri/default.nix
index dd436d1..cdace11 100644
--- a/modules/home/wayland/niri/default.nix
+++ b/modules/home/wayland/niri/default.nix
@@ -5,65 +5,74 @@
system,
lib,
...
-}: {
+}:
+{
options.chimera.niri = {
enable = lib.mkEnableOption "Use Niri as your window manager";
+ xwayland.enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ description = "Enable xwayland-satellite to run X apps in niri";
+ };
monitors = lib.mkOption {
- type = lib.types.attrsOf (lib.types.submodule {
- options = {
- enable = lib.mkOption {
- type = lib.types.bool;
- default = true;
- description = "Enable this monitor";
- };
- mode = lib.mkOption {
- type = lib.types.nullOr (lib.types.submodule {
- options = {
- width = lib.mkOption {
- type = lib.types.int;
- };
- height = lib.mkOption {
- type = lib.types.int;
- };
- refresh = lib.mkOption {
- type = lib.types.nullOr lib.types.float;
- default = null;
- };
- };
- });
- default = null;
- };
- position = lib.mkOption {
- type = lib.types.nullOr (lib.types.submodule {
- options = {
- x = lib.mkOption {
- type = lib.types.int;
- };
- y = lib.mkOption {
- type = lib.types.int;
- };
- };
- });
- default = null;
- };
- scale = lib.mkOption {
- type = lib.types.float;
- default = 1.;
- };
- transform = {
- flipped = lib.mkOption {
+ type = lib.types.attrsOf (
+ lib.types.submodule {
+ options = {
+ enable = lib.mkOption {
type = lib.types.bool;
- default = false;
+ default = true;
+ description = "Enable this monitor";
};
- rotation = lib.mkOption {
- type = lib.types.enum [ 0 90 180 270 ];
- default = 0;
+ mode = lib.mkOption {
+ type = lib.types.nullOr (
+ lib.types.submodule {
+ options = {
+ width = lib.mkOption { type = lib.types.int; };
+ height = lib.mkOption { type = lib.types.int; };
+ refresh = lib.mkOption {
+ type = lib.types.nullOr lib.types.float;
+ default = null;
+ };
+ };
+ }
+ );
+ default = null;
};
+ position = lib.mkOption {
+ type = lib.types.nullOr (
+ lib.types.submodule {
+ options = {
+ x = lib.mkOption { type = lib.types.int; };
+ y = lib.mkOption { type = lib.types.int; };
+ };
+ }
+ );
+ default = null;
+ };
+ scale = lib.mkOption {
+ type = lib.types.float;
+ default = 1.0;
+ };
+ transform = {
+ flipped = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ };
+ rotation = lib.mkOption {
+ type = lib.types.enum [
+ 0
+ 90
+ 180
+ 270
+ ];
+ default = 0;
+ };
+ };
+ variable-refresh-rate = lib.mkEnableOption "Enable Variable Refresh Rate (AMD FreeSync / Nvidia G-Sync)";
};
- variable-refresh-rate = lib.mkEnableOption "Enable Variable Refresh Rate (AMD FreeSync / Nvidia G-Sync)";
- };
- });
+ }
+ );
description = "Atribute set of monitors";
default = { };
};
@@ -84,46 +93,63 @@
config = lib.mkIf config.chimera.niri.enable {
chimera.wayland.enable = true;
- programs.bash.profileExtra = lib.mkIf config.chimera.shell.bash.enable (lib.mkBefore ''
- if [ -z $WAYLAND_DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
- exec ${pkgs.systemd}/bin/systemd-cat -t niri ${pkgs.dbus}/bin/dbus-run-session ${config.programs.niri.package}/bin/niri --session
- fi
- '');
+ programs.bash.profileExtra = lib.mkIf config.chimera.shell.bash.enable (
+ lib.mkBefore ''
+ if [ -z $WAYLAND_DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
+ exec ${pkgs.systemd}/bin/systemd-cat -t niri ${pkgs.dbus}/bin/dbus-run-session ${config.programs.niri.package}/bin/niri --session
+ fi
+ ''
+ );
- programs.zsh.profileExtra = lib.mkIf config.chimera.shell.zsh.enable (lib.mkBefore ''
- if [ -z $WAYLAND_DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
- exec ${pkgs.systemd}/bin/systemd-cat -t niri ${pkgs.dbus}/bin/dbus-run-session ${config.programs.niri.package}/bin/niri --session
- fi
- '');
+ programs.zsh.profileExtra = lib.mkIf config.chimera.shell.zsh.enable (
+ lib.mkBefore ''
+ if [ -z $WAYLAND_DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
+ exec ${pkgs.systemd}/bin/systemd-cat -t niri ${pkgs.dbus}/bin/dbus-run-session ${config.programs.niri.package}/bin/niri --session
+ fi
+ ''
+ );
- home.sessionVariables.NIXOS_OZONE_WL = "1";
+ programs.niri =
+ let
+ mod = "Super";
+ mod1 = "Alt";
+ terminal = "${pkgs.kitty}/bin/kitty";
+ menu = (
+ if config.chimera.runner.anyrun.enable then
+ "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun"
+ else
+ ""
+ );
- programs.niri = let
- mod = "Super";
- mod1 = "Alt";
- terminal = "${pkgs.kitty}/bin/kitty";
- menu = (if config.chimera.runner.anyrun.enable then "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun" else "");
-
- lock = ''${pkgs.swaylock}/bin/swaylock -i ${config.chimera.theme.wallpaper} -s fill'';
- in {
- enable = true;
- package = pkgs.niri-stable;
- settings = {
- input.keyboard = {
- track-layout = "window";
- repeat-delay = 200;
- repeat-rate = 25;
- xkb = {
- layout = config.chimera.input.keyboard.layout;
- variant = config.chimera.input.keyboard.variant;
+ lock = ''${pkgs.swaylock}/bin/swaylock -i ${config.chimera.theme.wallpaper} -s fill'';
+ in
+ {
+ enable = true;
+ package = pkgs.niri-stable;
+ settings = {
+ environment = {
+ NIXOS_OZONE_WL = "1";
+ DISPLAY = lib.mkIf config.chimera.niri.xwayland.enable ":0";
};
- };
+
+ input.keyboard = {
+ track-layout = "window";
+ repeat-delay = 200;
+ repeat-rate = 25;
+ xkb = {
+ layout = config.chimera.input.keyboard.layout;
+ variant = config.chimera.input.keyboard.variant;
+ };
+ };
input.mouse.natural-scroll = config.chimera.input.mouse.scrolling.natural;
input.touchpad.natural-scroll = config.chimera.input.touchpad.scrolling.natural;
input.warp-mouse-to-focus = true;
- input.focus-follows-mouse = true;
+ input.focus-follows-mouse = {
+ enable = true;
+ max-scroll-amount = "0%";
+ };
input.power-key-handling.enable = false;
@@ -283,6 +309,9 @@
{
command = [ "${pkgs.swaybg}/bin/swaybg" "-i" "${config.chimera.theme.wallpaper}" "-m" "fill" ];
}
+ {
+ command = [ "${pkgs.xwayland-satellite}/bin/xwayland-satellite" ];
+ }
] ++ config.chimera.niri.startupCommands;
};
};