Skip to content

Commit

Permalink
Use fromTOML on Nix >= 2.6.0 (#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-privatevoid authored Mar 30, 2022
1 parent 58758fe commit 4eed4c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions grammars.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4eed4c2

Please sign in to comment.