diff --git a/profiles/contexts/desktop/wm/hyprland.nix b/profiles/contexts/desktop/wm/hyprland.nix index 3941521..e3f40c2 100644 --- a/profiles/contexts/desktop/wm/hyprland.nix +++ b/profiles/contexts/desktop/wm/hyprland.nix @@ -57,23 +57,29 @@ in { extraLuaFiles."00-dms" = { autoLoad = true; content = '' - -- DMS setup/runtime owns these modules. Load only the Lua equivalents - -- of the pre-migration active sources, before local Home Manager - -- settings, preserving the old source-first order without enabling new - -- DMS default binds or rules. + -- DMS setup/runtime owns these modules. Load the Lua equivalents of + -- the pre-migration active sources (colors, layout, outputs) plus the + -- user-managed binds-user and windowrules, before local Home Manager + -- settings, preserving the old source-first order without enabling + -- DMS default binds (dms.binds stays unloaded). -- -- Keep fresh Home Manager generations usable before DMS has written - -- ~/.config/hypr/dms/*.lua. - local function require_if_present(module) - if package.searchpath(module, package.path) ~= nil then - require(module) - end - end - - require_if_present("dms.colors") - require_if_present("dms.layout") - require_if_present("dms.outputs") - require_if_present("dms.binds-user") + -- ~/.config/hypr/dms/*.lua: each require is guarded by + -- package.searchpath. Hyprland's safeLuaRequire would swallow a + -- missing module silently, but the guards keep `hyprctl + -- configerrors` clean. + -- + -- IMPORTANT: keep every require call as a literal single-line + -- statement. DMS detects inclusion via a static text scan + -- (dms config resolve-include, regex: word-boundary require + -- followed by a quoted module name) and does NOT follow wrapper + -- functions like require_if_present — hiding the calls behind a + -- helper made DMS report all dms modules as not included. + if package.searchpath("dms.colors", package.path) then require("dms.colors") end + if package.searchpath("dms.layout", package.path) then require("dms.layout") end + if package.searchpath("dms.outputs", package.path) then require("dms.outputs") end + if package.searchpath("dms.binds-user", package.path) then require("dms.binds-user") end + if package.searchpath("dms.windowrules", package.path) then require("dms.windowrules") end ''; }; settings = {