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