diff options
author | (cdep)illabout <cdep.illabout@gmail.com> | 2021-10-29 17:17:19 +0900 |
---|---|---|
committer | (cdep)illabout <cdep.illabout@gmail.com> | 2021-10-29 17:17:19 +0900 |
commit | 06a3718bc9d393727fbc7752fe9b6c094731dc8b (patch) | |
tree | 0481c643c06d49822af976fc85179f2a0b0df2ae /doc | |
parent | 9be3d05d7ce0b7681a9c5e0c1739959ba13d686e (diff) | |
download | nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar.gz nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar.bz2 nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar.lz nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar.xz nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.tar.zst nixpkgs-06a3718bc9d393727fbc7752fe9b6c094731dc8b.zip |
doc: Add explanation of --fixed-output-derivations arg for dhall-nixpkgs to Dhall section
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/dhall.section.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/languages-frameworks/dhall.section.md b/doc/languages-frameworks/dhall.section.md index d1adcbf736b..20470e337c1 100644 --- a/doc/languages-frameworks/dhall.section.md +++ b/doc/languages-frameworks/dhall.section.md @@ -342,6 +342,37 @@ $ dhall-to-nixpkgs directory ~/proj/dhall-semver } ``` +### Remote imports as fixed-output derivations {#ssec-dhall-remote-imports-as-fod} + +`dhall-to-nixpkgs` has the ability to fetch and build remote imports as +fixed-output derivations by using their Dhall integrity check. This is +sometimes easier than manually packaging all remote imports. + +This can be used like the following: + +```bash +$ dhall-to-nixpkgs directory --fixed-output-derivations ~/proj/dhall-semver +{ buildDhallDirectoryPackage, buildDhallUrl }: + buildDhallDirectoryPackage { + name = "proj"; + src = /Users/gabriel/proj/dhall-semver; + file = "package.dhall"; + source = false; + document = false; + dependencies = [ + (buildDhallUrl { + url = "https://prelude.dhall-lang.org/v17.0.0/package.dhall"; + hash = "sha256-ENs8kZwl6QRoM9+Jeo/+JwHcOQ+giT2VjDQwUkvlpD4="; + dhall-hash = "sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e"; + }) + ]; + } +``` + +Here, `dhall-semver`'s `Prelude` dependency is fetched and built with the +`buildDhallUrl` helper function, instead of being passed in as a function +argument. + ## Overriding dependency versions {#ssec-dhall-overriding-dependency-versions} Suppose that we change our `true.dhall` example expression to depend on an older |