hyprland: generate LuaLS config

This commit is contained in:
Austin Horstman
2026-05-13 15:22:50 -05:00
parent 03d2aa6317
commit 9760b31dab
3 changed files with 20 additions and 1 deletions

View File

@@ -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

View File

@@ -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}
'';
}

View File

@@ -0,0 +1 @@
{"diagnostics":{"globals":["hl"]},"workspace":{"library":["/nix/store/00000000000000000000000000000000-hyprland/share/hypr/stubs"]}}