Unnamed repository; edit this file 'description' to name the repository.
chore: clean up grammars.nix (#13506)
bloxx12 10 months ago
parent cb1ecc9 · commit 9bb370c
-rw-r--r--grammars.nix11
1 files changed, 1 insertions, 10 deletions
diff --git a/grammars.nix b/grammars.nix
index bc99d21d..371cafb0 100644
--- a/grammars.nix
+++ b/grammars.nix
@@ -1,22 +1,13 @@
{
stdenv,
lib,
- runCommandLocal,
runCommand,
- yj,
includeGrammarIf ? _: true,
grammarOverlays ? [],
...
}: let
- # HACK: nix < 2.6 has a bug in the toml parser, so we convert to JSON
- # before parsing
- languages-json = runCommandLocal "languages-toml-to-json" {} ''
- ${yj}/bin/yj -t < ${./languages.toml} > $out
- '';
languagesConfig =
- if lib.versionAtLeast builtins.nixVersion "2.6.0"
- then builtins.fromTOML (builtins.readFile ./languages.toml)
- else builtins.fromJSON (builtins.readFile (builtins.toPath languages-json));
+ builtins.fromTOML (builtins.readFile ./languages.toml);
isGitGrammar = grammar:
builtins.hasAttr "source" grammar
&& builtins.hasAttr "git" grammar.source