aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax2022-03-30 16:28:05 +0000
committerGitHub2022-03-30 16:28:05 +0000
commit4eed4c26e9f72a586f9175c4976d80ba091086e6 (patch)
tree603df37edc09a899808fde528a95445784e627a2
parent58758fee610a3808dfaeafddd1b4b4242a7e42cd (diff)
Use fromTOML on Nix >= 2.6.0 (#1892)
-rw-r--r--grammars.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/grammars.nix b/grammars.nix
index bcd2c2fa..ada14aaf 100644
--- a/grammars.nix
+++ b/grammars.nix
@@ -5,8 +5,10 @@ let
languages-json = runCommand "languages-toml-to-json" { } ''
${yj}/bin/yj -t < ${./languages.toml} > $out
'';
- languagesConfig =
- builtins.fromJSON (builtins.readFile (builtins.toPath languages-json));
+ 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));
isGitGrammar = (grammar:
builtins.hasAttr "source" grammar && builtins.hasAttr "git" grammar.source
&& builtins.hasAttr "rev" grammar.source);