dhallPackages.generateDhallDirectoryPackage: init
This commit is contained in:
parent
6e020a08e2
commit
a1933f6a9d
|
@ -0,0 +1,27 @@
|
||||||
|
{ dhall-nixpkgs, lib, stdenv }:
|
||||||
|
|
||||||
|
# This function calls `dhall-to-nixpkgs directory --fixed-output-derivations`
|
||||||
|
# within a Nix derivation.
|
||||||
|
#
|
||||||
|
# This is possible because
|
||||||
|
# `dhall-to-nixpkgs directory --fixed-output-derivations` will turn remote
|
||||||
|
# Dhall imports protected with Dhall integrity checksinto fixed-output
|
||||||
|
# derivations (with the `buildDhallUrl` function), so no unrestricted network
|
||||||
|
# access is necessary.
|
||||||
|
lib.makePackageOverridable
|
||||||
|
( { src
|
||||||
|
, # The file to import, relative to the root directory
|
||||||
|
file ? "package.dhall"
|
||||||
|
, # Set to `true` to generate documentation for the package
|
||||||
|
document ? false
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "dhall-directory-package.nix";
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
dhall-to-nixpkgs directory --fixed-output-derivations --file "${file}" "${src}" ${if document then "--document" else ""} > $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ dhall-nixpkgs ];
|
||||||
|
}
|
||||||
|
)
|
|
@ -20,6 +20,9 @@ let
|
||||||
buildDhallUrl =
|
buildDhallUrl =
|
||||||
callPackage ../development/interpreters/dhall/build-dhall-url.nix { };
|
callPackage ../development/interpreters/dhall/build-dhall-url.nix { };
|
||||||
|
|
||||||
|
generateDhallDirectoryPackage =
|
||||||
|
callPackage ../development/interpreters/dhall/generate-dhall-directory-package.nix { };
|
||||||
|
|
||||||
in
|
in
|
||||||
{ inherit
|
{ inherit
|
||||||
callPackage
|
callPackage
|
||||||
|
@ -27,6 +30,7 @@ let
|
||||||
buildDhallGitHubPackage
|
buildDhallGitHubPackage
|
||||||
buildDhallDirectoryPackage
|
buildDhallDirectoryPackage
|
||||||
buildDhallUrl
|
buildDhallUrl
|
||||||
|
generateDhallDirectoryPackage
|
||||||
;
|
;
|
||||||
|
|
||||||
lib = import ../development/dhall-modules/lib.nix { inherit lib; };
|
lib = import ../development/dhall-modules/lib.nix { inherit lib; };
|
||||||
|
|
Loading…
Reference in a new issue