feat: Change nix formatter to alejandra

This commit is contained in:
ulic-youthlic 2025-11-09 06:25:03 +08:00
parent 0b8b647f05
commit b4c3dfec42
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
229 changed files with 2528 additions and 2884 deletions

View file

@ -4,14 +4,12 @@
callPackage,
buildEnv,
lib,
}:
let
}: let
inherit (stdenv.hostPlatform) system;
inherit (inputs.helix.packages."${system}") helix;
runtime = callPackage ./runtime.nix { };
runtime = callPackage ./runtime.nix {};
helix' = helix.overrideAttrs (
_final: prev:
let
_final: prev: let
helix-runtime = buildEnv {
name = "helix-runtime";
paths = [
@ -19,18 +17,19 @@ let
prev.env.HELIX_DEFAULT_RUNTIME
];
};
in
{
in {
env.HELIX_DEFAULT_RUNTIME = toString helix-runtime;
}
);
in
helix'
// {
passthru = (helix'.passthru or { }) // {
languages = lib.pipe "${helix.src}/languages.toml" [
builtins.readFile
builtins.fromTOML
];
};
}
helix'
// {
passthru =
(helix'.passthru or {})
// {
languages = lib.pipe "${helix.src}/languages.toml" [
builtins.readFile
builtins.fromTOML
];
};
}

View file

@ -3,10 +3,8 @@
srcs,
stdenv,
runCommandLocal,
}:
let
buildGrammar =
grammar:
}: let
buildGrammar = grammar:
stdenv.mkDerivation {
pname = "helix-tree-sitter-${grammar.name}";
version = grammar.version;
@ -60,10 +58,9 @@ let
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: ''
@ -73,8 +70,7 @@ let
''
))
];
grammarLinks =
with lib;
grammarLinks = with lib;
pipe grammars [
(builtins.mapAttrs (
_: v: {
@ -84,20 +80,20 @@ let
))
(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
''