summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-01-12 00:04:23 +0000
committerGitHub <noreply@github.com>2020-01-12 00:04:23 +0000
commit100012e55bc2a82fc680cba31a426ad38ead6fab (patch)
treefb79ef27712a595fdf45d91dd1b29cc99f80c12c /pkgs/development/tools
parenta7635ad8b543a7d69759cb82108f995b412578a7 (diff)
parent1282b60452b32d625d537fd26c17f76b28208c24 (diff)
downloadnixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar.gz
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar.bz2
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar.lz
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar.xz
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.tar.zst
nixpkgs-100012e55bc2a82fc680cba31a426ad38ead6fab.zip
Merge pull request #77538 from adisbladis/poetry2nix-1_2_1
poetry2nix: 1.2.0 -> 1.2.1
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/lib.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
index 3d0b80c4c5a..559c3051a73 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
@@ -30,7 +30,25 @@ let
     in
       (builtins.foldl' combine initial tokens).state;
 
-  readTOML = path: builtins.fromTOML (builtins.readFile path);
+  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
+          ''
+      )
+    );
+  readTOML = path: fromTOML (builtins.readFile path);
 
   #
   # Returns the appropriate manylinux dependencies and string representation for the file specified