chore: Use nixfmt reformat all nix source code

This commit is contained in:
ulic-youthlic 2026-07-04 23:11:21 +08:00
parent 1cdf00cefe
commit 11337b8f9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
184 changed files with 2349 additions and 1943 deletions

View file

@ -3,8 +3,10 @@
srcs,
stdenv,
runCommandLocal,
}: let
buildGrammar = grammar:
}:
let
buildGrammar =
grammar:
stdenv.mkDerivation {
pname = "helix-tree-sitter-${grammar.name}";
version = grammar.version;
@ -58,9 +60,10 @@
runHook postFixup
'';
};
grammars = with lib; pipe srcs [(filterAttrs (key: _: hasPrefix "tree-sitter-" key))];
grammars = with lib; pipe srcs [ (filterAttrs (key: _: hasPrefix "tree-sitter-" key)) ];
queries = with lib;
queries =
with lib;
pipe grammars [
(mapAttrsToList (
_: value: ''
@ -70,7 +73,8 @@
''
))
];
grammarLinks = with lib;
grammarLinks =
with lib;
pipe grammars [
(builtins.mapAttrs (
_: v: {
@ -80,20 +84,20 @@
))
(mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"))
];
grammarDir = runCommandLocal "helix-grammars" {} ''
grammarDir = runCommandLocal "helix-grammars" { } ''
mkdir -p $out
${builtins.concatStringsSep "\n" grammarLinks}
'';
queryDir = runCommandLocal "helix-query" {} ''
queryDir = runCommandLocal "helix-query" { } ''
mkdir -p $out
${builtins.concatStringsSep "\n" queries}
'';
in
runCommandLocal "helix-runtime" {} ''
mkdir -p $out
runCommandLocal "helix-runtime" { } ''
mkdir -p $out
ln -s ${grammarDir} $out/grammars
ln -s ${queryDir} $out/queries
''
ln -s ${grammarDir} $out/grammars
ln -s ${queryDir} $out/queries
''