about summary refs log tree commit diff
path: root/pkgs/development/interpreters/dhall/build-dhall-directory-package.nix
blob: b4401a85d141a7c3b4ecaf92029fa22a2afc0256 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ buildDhallPackage, lib }:

# This is a minor variation on `buildDhallPackage` that splits the `code`
# argument into `src` and `file` in such a way that you can easily override
# the `file`
#
# This function is used by `dhall-to-nixpkgs` when given a directory
lib.makeOverridable
  ( { # Arguments passed through to `buildDhallPackage`
      name
    , dependencies ? []
    , source ? false

    , src
    , # The file to import, relative to the root directory
      file ? "package.dhall"
    }:

    buildDhallPackage {
      inherit name dependencies source;

      code = "${src}/${file}";
    }
  )