summary refs log tree commit diff
path: root/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/poetry2nix/poetry2nix/lib.nix')
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/lib.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
index 559c3051a73..68d854f2648 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
@@ -30,22 +30,24 @@ let
     in
       (builtins.foldl' combine initial tokens).state;
 
-  fromTOML = toml: if builtins.hasAttr "fromTOML" builtins then builtins.fromTOML toml else
-    builtins.fromJSON (
-      builtins.readFile (
-        pkgs.runCommand "from-toml"
-          {
-            inherit toml;
-            allowSubstitutes = false;
-            preferLocalBuild = true;
-          }
-          ''
-            ${pkgs.remarshal}/bin/remarshal \
-              -if toml \
-              -i <(echo "$toml") \
-              -of json \
-              -o $out
-          ''
+  fromTOML = builtins.fromTOML or
+    (
+      toml: builtins.fromJSON (
+        builtins.readFile (
+          pkgs.runCommand "from-toml"
+            {
+              inherit toml;
+              allowSubstitutes = false;
+              preferLocalBuild = true;
+            }
+            ''
+              ${pkgs.remarshal}/bin/remarshal \
+                -if toml \
+                -i <(echo "$toml") \
+                -of json \
+                -o $out
+            ''
+        )
       )
     );
   readTOML = path: fromTOML (builtins.readFile path);