diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix b/infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix index 9303244eb885..039c50f06937 100644 --- a/infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix +++ b/infra/libkookie/nixpkgs/pkgs/development/interpreters/dhall/build-dhall-package.nix @@ -1,4 +1,4 @@ -{ dhall, haskell, lib, lndir, runCommand, writeText }: +{ dhall, dhall-docs, haskell, lib, lndir, runCommand, writeText }: { name @@ -31,6 +31,12 @@ # space within the Nix store, but if you set the following `source` option to # `true` then the package will also include `source.dhall`. , source ? false + + # Directory to generate documentation for (i.e. as the `--input` option to the + # `dhall-docs` command.) + # + # If `null`, then no documentation is generated. +, documentationRoot ? null }: let @@ -42,8 +48,12 @@ let cache = ".cache"; + data = ".local/share"; + cacheDhall = "${cache}/dhall"; + dataDhall = "${data}/dhall"; + sourceFile = "source.dhall"; in @@ -71,4 +81,10 @@ in echo "missing $SHA_HASH" > $out/binary.dhall ${lib.optionalString (!source) "rm $out/${sourceFile}"} + + ${lib.optionalString (documentationRoot != null) '' + mkdir -p $out/${dataDhall} + + XDG_DATA_HOME=$out/${data} ${dhall-docs}/bin/dhall-docs --input '${documentationRoot}' --output-link $out/docs + ''} '' |