nixpkgs/pkgs
Gabriel Gonzalez 38f1d70c01 Add Nixpkgs support for Dhall
One of the motivations for this change is the following Discourse
discussion:

https://discourse.dhall-lang.org/t/offline-use-of-prelude/137

Many users have requested Dhall support for "offline" packages
that can be fetched/built/installed using ordinary package
management tools (like Nix) instead of using Dhall's HTTP import system.
I will continue to use the term "offline" to mean Dhall package
builds that do not use Dhall's language support for HTTP imports (and
instead use the package manager's support for HTTP requests, such
as `pkgs.fetchFromGitHub`)

The goal of this change is to document what is the idiomatic way to
implement "offline" Dhall builds by implementing Nixpkgs support
for such builds.  That way when other package management tools ask
me how to package Dhall with their tools I can refer them to how it
is done in Nixpkgs.

This change contains a fully "offline" build for the largest Dhall
package in existence, known as "dhall-packages" (not to be confused
with `dhallPackages`, which is our Nix attribute set containing
Dhall packages).

The trick to implementing offline builds in Dhall is to take
advantage of Dhall's support for semantic integrity checks.  If an
HTTP import is protected by an integrity check and a cached build
product matches the integrity check then the HTTP import is never
resolved and the expression is instead fetched from cache.

By "installing" dependencies in a pre-seeded and isolated cache
we can replace remote HTTP imports with dependencies that have
been built and supplied by Nix instead.

The offline nature of the builds are enforced by compiling the
Haskell interpreter with the `-f-with-http` flag, which disables
the interpreter's support for HTTP imports.  If a user forgets
to supply a necessary dependency as a Nix build product then the
build fails informing them that HTTP imports are disabled.

By default, built packages are "binary distributions", containing
just a cache product and a Dhall expression which can be used to
resolve the corresponding cache product.

Users can also optionally enable a "source distribution" of a package
which already includes the equivalent fully-evaluated Dhall code (for
convenience), but this is disabled by default to keep `/nix/store`
utilization as compact as possible.
2020-02-11 22:02:53 -08:00
..
applications kops_1_15: 1.15.1 -> 1.15.2 (#79809) 2020-02-11 21:35:35 +01:00
build-support buildRustCrate: remap the current build dir to / for (more) reproducible builds 2020-02-06 01:18:59 +01:00
common-updater common-updater-scripts: move destructive changes further in the script 2020-02-04 06:25:38 +01:00
data Merge pull request #79865 from r-ryantm/auto-update/spdx-license-list-data 2020-02-11 20:21:29 -05:00
desktops gnomeExtensions.gsconnect: fix build 2020-02-11 17:16:00 +01:00
development Add Nixpkgs support for Dhall 2020-02-11 22:02:53 -08:00
games dxx-rebirth: 0.59.100 -> 0.59.20200202 2020-02-10 20:00:22 +01:00
misc xlockmore: 5.61 -> 5.62 2020-02-10 22:21:55 +00:00
os-specific linux: 5.5.2 -> 5.5.3 2020-02-11 14:42:38 -05:00
servers matomo: 3.13.1 -> 3.13.2 2020-02-11 19:16:13 +01:00
shells oh-my-zsh: 2020-02-07 -> 2020-02-11 2020-02-11 14:48:14 -05:00
stdenv make-bootstrap-tools: fixup after glibc update 2020-02-10 17:31:35 +01:00
test tests.nixos-functions: port test to python 2020-02-09 23:53:58 +01:00
tools gist: 5.0.0 -> 5.1.0 (#79838) 2020-02-11 21:35:01 +01:00
top-level Add Nixpkgs support for Dhall 2020-02-11 22:02:53 -08:00