fixed modules_root misassignment and added fallback, made overridable in flake
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
-- ~/.config/hypr/autoload.lua
|
-- ~/.config/hypr/autoload.lua
|
||||||
|
|
||||||
-- Path to search
|
-- Path to search
|
||||||
-- local modules = os.getenv("HOME") .. "/.config/hypr/modules"
|
local modules
|
||||||
local modules = os.getenv("MODULES_ROOT") .. "/modules"
|
|
||||||
|
if os.getenv("MODULES_ROOT") then
|
||||||
|
modules = os.getenv("MODULES_ROOT")
|
||||||
|
else
|
||||||
|
modules = os.getenv("HOME") .. "/.config/hypr/modules"
|
||||||
|
end
|
||||||
|
|
||||||
-- Get all files in modules dir
|
-- Get all files in modules dir
|
||||||
local p = io.popen('find -L "' .. modules .. '" -name "*.lua" -type f | sort')
|
local p = io.popen('find -L "' .. modules .. '" -name "*.lua" -type f | sort')
|
||||||
|
|||||||
@@ -59,10 +59,10 @@
|
|||||||
runtimePackages,
|
runtimePackages,
|
||||||
exePath,
|
exePath,
|
||||||
flags,
|
flags,
|
||||||
|
env,
|
||||||
}:
|
}:
|
||||||
(wrappers.lib.wrapPackage {
|
(wrappers.lib.wrapPackage {
|
||||||
inherit pkgs package exePath flags;
|
inherit env pkgs package exePath flags;
|
||||||
env = {"MODULES_ROOT" = ./.;};
|
|
||||||
}).overrideAttrs (old: {
|
}).overrideAttrs (old: {
|
||||||
passthru = (old.passthru or {}) // {inherit runtimePackages;};
|
passthru = (old.passthru or {}) // {inherit runtimePackages;};
|
||||||
});
|
});
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
package = hypr;
|
package = hypr;
|
||||||
runtimePackages = defaultRuntimePkgs;
|
runtimePackages = defaultRuntimePkgs;
|
||||||
exePath = pkgs.lib.getExe hypr;
|
exePath = pkgs.lib.getExe hypr;
|
||||||
|
env."MODULES_ROOT" = ./modules;
|
||||||
flags."--config" = ./hyprland.lua;
|
flags."--config" = ./hyprland.lua;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user