dhallPackages.generateDhallDirectoryPackage: init

+31
+27
pkgs/development/interpreters/dhall/generate-dhall-directory-package.nix
··· 1 + { dhall-nixpkgs, lib, stdenv }: 2 + 3 + # This function calls `dhall-to-nixpkgs directory --fixed-output-derivations` 4 + # within a Nix derivation. 5 + # 6 + # This is possible because 7 + # `dhall-to-nixpkgs directory --fixed-output-derivations` will turn remote 8 + # Dhall imports protected with Dhall integrity checksinto fixed-output 9 + # derivations (with the `buildDhallUrl` function), so no unrestricted network 10 + # access is necessary. 11 + lib.makePackageOverridable 12 + ( { src 13 + , # The file to import, relative to the root directory 14 + file ? "package.dhall" 15 + , # Set to `true` to generate documentation for the package 16 + document ? false 17 + }: 18 + stdenv.mkDerivation { 19 + name = "dhall-directory-package.nix"; 20 + 21 + buildCommand = '' 22 + dhall-to-nixpkgs directory --fixed-output-derivations --file "${file}" "${src}" ${if document then "--document" else ""} > $out 23 + ''; 24 + 25 + nativeBuildInputs = [ dhall-nixpkgs ]; 26 + } 27 + )
+4
pkgs/top-level/dhall-packages.nix
··· 20 20 buildDhallUrl = 21 21 callPackage ../development/interpreters/dhall/build-dhall-url.nix { }; 22 22 23 + generateDhallDirectoryPackage = 24 + callPackage ../development/interpreters/dhall/generate-dhall-directory-package.nix { }; 25 + 23 26 in 24 27 { inherit 25 28 callPackage ··· 27 30 buildDhallGitHubPackage 28 31 buildDhallDirectoryPackage 29 32 buildDhallUrl 33 + generateDhallDirectoryPackage 30 34 ; 31 35 32 36 lib = import ../development/dhall-modules/lib.nix { inherit lib; };