From 2064348e555b6aa963da6372a8f14e6acb80a176 Mon Sep 17 00:00:00 2001 From: Samuele Facenda Date: Fri, 19 Jan 2024 11:27:00 +0100 Subject: [PATCH] hyprland: do not override existing plugins settings in config The plugin setting in the Hyprland config is used both for defining plugin paths and configuring the plugins. This fix removes the silent override of the plugins settings converting them to the `plugin: { ...settings }` syntax. --- modules/services/window-managers/hyprland.nix | 3 ++- .../services/window-managers/hyprland/simple-config.conf | 7 +++++++ .../services/window-managers/hyprland/simple-config.nix | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 9bf9cb29..d677eda7 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -207,7 +207,8 @@ in { else entry; in map mkEntry cfg.plugins; - }; + } // lib.mapAttrs' (n: v: lib.nameValuePair "plugin:${n}" v) + (lib.attrByPath [ "plugin" ] { } cfg.settings); shouldGenerate = cfg.systemd.enable || cfg.extraConfig != "" || combinedSettings != { }; diff --git a/tests/modules/services/window-managers/hyprland/simple-config.conf b/tests/modules/services/window-managers/hyprland/simple-config.conf index d715fad0..4df74413 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.conf +++ b/tests/modules/services/window-managers/hyprland/simple-config.conf @@ -26,6 +26,13 @@ input { follow_mouse=1 kb_layout=ro } + +plugin:plugin1 { + section { + other=dummy setting + } + dummy=plugin setting +} bindm=$mod, mouse:272, movewindow bindm=$mod, mouse:273, resizewindow bindm=$mod ALT, mouse:272, resizewindow diff --git a/tests/modules/services/window-managers/hyprland/simple-config.nix b/tests/modules/services/window-managers/hyprland/simple-config.nix index 31fe0432..f45bf6b3 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.nix +++ b/tests/modules/services/window-managers/hyprland/simple-config.nix @@ -45,6 +45,13 @@ "$mod, mouse:273, resizewindow" "$mod ALT, mouse:272, resizewindow" ]; + + plugin = { + plugin1 = { + dummy = "plugin setting"; + section = { other = "dummy setting"; }; + }; + }; }; extraConfig = '' # window resize