From 3f55cc361c9f7a167b225efeb58097dd5b617454 Mon Sep 17 00:00:00 2001 From: "git@71rd.net" Date: Mon, 24 Jun 2024 23:58:09 +0000 Subject: [PATCH 1/2] nixos/wayfire: fix import file with settings required to start service Wayfire does not start without further configuration, when programs.wayfire.enable is the only wayland wm enabled. When sway or a similar program is also enabled that program imports wayland-session.nix hiding the problem. This imports wayland-session.nix and adds the option xwayland.enable to pass to the file --- nixos/modules/programs/wayland/wayfire.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/wayland/wayfire.nix b/nixos/modules/programs/wayland/wayfire.nix index 7acc5b2739cb..9e618cd65645 100644 --- a/nixos/modules/programs/wayland/wayfire.nix +++ b/nixos/modules/programs/wayland/wayfire.nix @@ -25,6 +25,7 @@ in Additional plugins to use with the wayfire window manager. ''; }; + xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; }; }; config = let @@ -33,7 +34,7 @@ in plugins = cfg.plugins; }; in - lib.mkIf cfg.enable { + lib.mkIf cfg.enable (lib.mkMerge [{ environment.systemPackages = [ finalPackage ]; @@ -46,5 +47,10 @@ in # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050914 config.wayfire.default = lib.mkDefault [ "wlr" "gtk" ]; }; - }; + } + (import ./wayland-session.nix { + inherit lib pkgs; + enableXWayland = cfg.xwayland.enable; + }) + ]); } From 2483ea35cd29d26d206319032fcdb67e144e5dfb Mon Sep 17 00:00:00 2001 From: "git@71rd.net" Date: Mon, 29 Jul 2024 16:13:55 +0000 Subject: [PATCH 2/2] modules/wayfire: nixfmt Signed-off-by: git@71rd.net --- nixos/modules/programs/wayland/wayfire.nix | 67 +++++++++++++--------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/nixos/modules/programs/wayland/wayfire.nix b/nixos/modules/programs/wayland/wayfire.nix index 9e618cd65645..1c3950bff47d 100644 --- a/nixos/modules/programs/wayland/wayfire.nix +++ b/nixos/modules/programs/wayland/wayfire.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ...}: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.programs.wayfire; in @@ -12,7 +17,10 @@ in plugins = lib.mkOption { type = lib.types.listOf lib.types.package; - default = with pkgs.wayfirePlugins; [ wcm wf-shell ]; + default = with pkgs.wayfirePlugins; [ + wcm + wf-shell + ]; defaultText = lib.literalExpression "with pkgs.wayfirePlugins; [ wcm wf-shell ]"; example = lib.literalExpression '' with pkgs.wayfirePlugins; [ @@ -25,32 +33,39 @@ in Additional plugins to use with the wayfire window manager. ''; }; - xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; }; + xwayland.enable = lib.mkEnableOption "XWayland" // { + default = true; + }; }; - config = let - finalPackage = pkgs.wayfire-with-plugins.override { - wayfire = cfg.package; - plugins = cfg.plugins; - }; - in - lib.mkIf cfg.enable (lib.mkMerge [{ - environment.systemPackages = [ - finalPackage - ]; + config = + let + finalPackage = pkgs.wayfire-with-plugins.override { + wayfire = cfg.package; + plugins = cfg.plugins; + }; + in + lib.mkIf cfg.enable ( + lib.mkMerge [ + { + environment.systemPackages = [ finalPackage ]; - services.displayManager.sessionPackages = [ finalPackage ]; + services.displayManager.sessionPackages = [ finalPackage ]; - xdg.portal = { - enable = lib.mkDefault true; - wlr.enable = lib.mkDefault true; - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050914 - config.wayfire.default = lib.mkDefault [ "wlr" "gtk" ]; - }; - } - (import ./wayland-session.nix { - inherit lib pkgs; - enableXWayland = cfg.xwayland.enable; - }) - ]); + xdg.portal = { + enable = lib.mkDefault true; + wlr.enable = lib.mkDefault true; + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050914 + config.wayfire.default = lib.mkDefault [ + "wlr" + "gtk" + ]; + }; + } + (import ./wayland-session.nix { + inherit lib pkgs; + enableXWayland = cfg.xwayland.enable; + }) + ] + ); }