query
On this page

dhallPackageToNix

pkgs.dhallPackageToNix

Functor
Docs pulled from | This Revision | 30 minutes ago


Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.

Noogle detected

This is a Functor

Learn about functors

Implementation

The following is the current implementation of this function.

dhallPackage:
let
  drv = stdenv.mkDerivation {
    name = "dhall-compiled-package.nix";

    buildCommand = ''
      # Dhall requires that the cache is writable, even if it is never written to.
      # We copy the cache from the input package to the current directory and
      # set the cache as writable.
      cp -r "${dhallPackage}/.cache" ./
      export XDG_CACHE_HOME=$PWD/.cache
      chmod -R +w ./.cache

      dhall-to-nix <<< "${dhallPackage}/binary.dhall" > $out
    '';

    nativeBuildInputs = [ dhall-nix ];
  };

in
import drv