nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 dhall-nixpkgs,
3 lib,
4 stdenv,
5}:
6
7# This function calls `dhall-to-nixpkgs directory --fixed-output-derivations`
8# within a Nix derivation.
9#
10# This is possible because
11# `dhall-to-nixpkgs directory --fixed-output-derivations` will turn remote
12# Dhall imports protected with Dhall integrity checksinto fixed-output
13# derivations (with the `buildDhallUrl` function), so no unrestricted network
14# access is necessary.
15lib.makePackageOverridable (
16 {
17 src,
18 # The file to import, relative to the root directory
19 file ? "package.dhall",
20 # Set to `true` to generate documentation for the package
21 document ? false,
22 }:
23 stdenv.mkDerivation {
24 name = "dhall-directory-package.nix";
25
26 buildCommand = ''
27 dhall-to-nixpkgs directory --fixed-output-derivations --file "${file}" "${src}" ${lib.optionalString document "--document"} > $out
28 '';
29
30 nativeBuildInputs = [ dhall-nixpkgs ];
31 }
32)