diff options
author | Gabriella Gonzalez <Gabriel439@gmail.com> | 2021-08-21 19:25:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 19:25:01 -0700 |
commit | 9a8850aea97840dca1cc1087447ed89dbfe183dc (patch) | |
tree | 00b97e2190a220763b7db17651cd14ec4fc8725f /pkgs/build-support/dhall-to-nix.nix | |
parent | 1c145df9ae6f06d96e1e3127011ec3513b09dd3e (diff) | |
download | nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar.gz nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar.bz2 nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar.lz nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar.xz nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.tar.zst nixpkgs-9a8850aea97840dca1cc1087447ed89dbfe183dc.zip |
dhallToNix: Permit inputs referring to derivations (#134459)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/2267 `pkgs.dhallToNix` currently fails when a Dhall package is interpolated into the input source code, like this: ```nix let pkgs = import <nixpkgs> { }; f = { buildDhallPackage }: buildDhallPackage { name = "not"; code = "λ(x : Bool) → x == False"; source = true; }; not = pkgs.dhallPackages.callPackage f {}; in pkgs.dhallToNix "${not}/source.dhall True" ``` This is because `dhallToNix` was using `builtins.toFile`, which does not permit inputs with interpolated derivations. However, `pkgs.writeText` does not have this limitation, so we can switch to using that instead.
Diffstat (limited to 'pkgs/build-support/dhall-to-nix.nix')
-rw-r--r-- | pkgs/build-support/dhall-to-nix.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/dhall-to-nix.nix b/pkgs/build-support/dhall-to-nix.nix index 3805656dfa0..96cc16e16f3 100644 --- a/pkgs/build-support/dhall-to-nix.nix +++ b/pkgs/build-support/dhall-to-nix.nix @@ -15,12 +15,12 @@ Note that this uses "import from derivation", meaning that Nix will perform a build during the evaluation phase if you use this `dhallToNix` utility */ -{ stdenv, dhall-nix }: +{ stdenv, dhall-nix, writeText }: let dhallToNix = code : let - file = builtins.toFile "dhall-expression" code; + file = writeText "dhall-expression" code; drv = stdenv.mkDerivation { name = "dhall-compiled.nix"; |