feat: templ

Signed-off-by: jolheiser <john.olheiser@gmail.com>
teamcity
jolheiser 2023-09-14 21:03:19 -05:00
parent 933226d71b
commit e58b8bf761
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
3 changed files with 47 additions and 5 deletions

View File

@ -42,6 +42,7 @@
# Flake overlays
jolheiser.git-age
jolheiser.templ
tclip
];
activation.report-changes = config.lib.dag.entryAnywhere ''

View File

@ -1,4 +1,13 @@
{
{pkgs, ...}: let
queries = pkgs.fetchFromGitea {
domain = "git.jojodev.com";
owner = "jolheiser";
repo = "templ-helix";
rev = "2a47b9c5af0fd9ae8bba8198fd66abc6d07fdf10";
sha256 = "sha256-pTdOX9bPup626t+ko6k3Xq/tprAMAZCUBl+xeIBkhfs=";
};
query = scm: builtins.readFile (queries + "/queries/templ/${scm}.scm");
in {
programs.helix = {
enable = true;
defaultEditor = true;
@ -180,6 +189,32 @@
args = ["-qq"];
};
}
{
name = "templ";
auto-format = true;
scope = "source.templ";
injection-regex = "templ";
file-types = ["templ"];
roots = ["go.mod"];
comment-token = "//";
language-server = {
command = "templ";
args = ["lsp"];
};
formatter = {
command = "templ";
args = ["fmt"];
};
}
];
grammar = [
{
name = "templ";
source = {
git = "https://github.com/vrischmann/tree-sitter-templ";
rev = "9f63037ad08a58050d0582ef1ae0009bd0fbf2f1";
};
}
];
};
themes = {
@ -201,4 +236,10 @@
};
};
};
xdg.configFile = {
"helix/runtime/queries/templ/highlights.scm".text = query "highlights";
"helix/runtime/queries/templ/indents.scm".text = query "indents";
"helix/runtime/queries/templ/injections.scm".text = query "injections";
"helix/runtime/queries/templ/structure.scm".text = query "structure";
};
}

View File

@ -115,11 +115,11 @@
]
},
"locked": {
"lastModified": 1694718292,
"narHash": "sha256-x74EG3+M2dz3Kto/KqMov+0/ieShlz/lIoJPQuuhLeM=",
"lastModified": 1694739610,
"narHash": "sha256-8uaewp23kpGZtCF2vjuZR0QJRC0iXC6nyoxI/+7s6sg=",
"ref": "refs/heads/main",
"rev": "cf69cfa8319211e017e1017f6374a3c28629c3a7",
"revCount": 164,
"rev": "337275b6dd4514ee7dd0dd0858dccbdbca7853c2",
"revCount": 166,
"type": "git",
"url": "https://git.jojodev.com/jolheiser/nur"
},