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

@ -4,12 +4,14 @@
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 = [
@ -17,25 +19,22 @@
prev.env.HELIX_DEFAULT_RUNTIME
];
};
in {
in
{
env.HELIX_DEFAULT_RUNTIME = toString helix-runtime;
cargoBuildFeatures =
(prev.cargoBuildFeatures or [])
++ [
"git"
"steel"
];
cargoBuildFeatures = (prev.cargoBuildFeatures or [ ]) ++ [
"git"
"steel"
];
}
);
in
helix'
// {
passthru =
(helix'.passthru or {})
// {
languages = lib.pipe "${helix.src}/languages.toml" [
builtins.readFile
fromTOML
];
};
}
helix'
// {
passthru = (helix'.passthru or { }) // {
languages = lib.pipe "${helix.src}/languages.toml" [
builtins.readFile
fromTOML
];
};
}

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