mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
hyprland: generate LuaLS config
This commit is contained in:
@@ -480,6 +480,14 @@ in
|
||||
);
|
||||
|
||||
xdg.configFile = lib.mkMerge [
|
||||
{
|
||||
"hypr/.luarc.json" = lib.mkIf (cfg.configType == "lua" && cfg.finalPackage != null) {
|
||||
text = builtins.toJSON {
|
||||
workspace.library = [ "${cfg.finalPackage}/share/hypr/stubs" ];
|
||||
diagnostics.globals = [ "hl" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"hypr/hyprland.conf" = lib.mkIf (cfg.configType == "hyprlang") (
|
||||
let
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
hyprland = config.lib.test.mkStubPackage { name = "hyprland"; };
|
||||
in
|
||||
|
||||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
configType = "lua";
|
||||
package = null;
|
||||
package = hyprland // {
|
||||
override = _: hyprland;
|
||||
};
|
||||
portalPackage = null;
|
||||
|
||||
plugins = [
|
||||
@@ -200,10 +206,14 @@
|
||||
|
||||
nmt.script = ''
|
||||
config=home-files/.config/hypr/hyprland.lua
|
||||
luarc=home-files/.config/hypr/.luarc.json
|
||||
assertFileExists "$config"
|
||||
assertFileExists "$luarc"
|
||||
assertPathNotExists home-files/.config/hypr/hyprland.conf
|
||||
assertFileNotRegex "$config" "ignored-hyprlang-bind"
|
||||
normalizedConfig=$(normalizeStorePaths "$config")
|
||||
normalizedLuarc=$(normalizeStorePaths "$luarc")
|
||||
assertFileContent "$normalizedConfig" ${./lua-config.lua}
|
||||
assertFileContent "$normalizedLuarc" ${./luarc.json}
|
||||
'';
|
||||
}
|
||||
|
||||
1
tests/modules/services/hyprland/luarc.json
Normal file
1
tests/modules/services/hyprland/luarc.json
Normal file
@@ -0,0 +1 @@
|
||||
{"diagnostics":{"globals":["hl"]},"workspace":{"library":["/nix/store/00000000000000000000000000000000-hyprland/share/hypr/stubs"]}}
|
||||
Reference in New Issue
Block a user