nixpkgs/pkgs/top-level/dhall-packages.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

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-12 06:02:53 +00:00
{ lib
, newScope
, overrides ? (self: super: {})
}:
let
packages = self:
let
callPackage = newScope self;
buildDhallPackage =
callPackage ../development/interpreters/dhall/build-dhall-package.nix { };
buildDhallGitHubPackage =
callPackage ../development/interpreters/dhall/build-dhall-github-package.nix { };
buildDhallDirectoryPackage =
callPackage ../development/interpreters/dhall/build-dhall-directory-package.nix { };
buildDhallUrl =
callPackage ../development/interpreters/dhall/build-dhall-url.nix { };
generateDhallDirectoryPackage =
callPackage ../development/interpreters/dhall/generate-dhall-directory-package.nix { };
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-12 06:02:53 +00:00
in
{ inherit
callPackage
buildDhallPackage
buildDhallGitHubPackage
buildDhallDirectoryPackage
buildDhallUrl
generateDhallDirectoryPackage
;
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-12 06:02:53 +00:00
lib = import ../development/dhall-modules/lib.nix { inherit lib; };
2021-11-06 03:26:24 +00:00
dhall-grafana =
callPackage ../development/dhall-modules/dhall-grafana.nix { };
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-12 06:02:53 +00:00
dhall-kubernetes =
callPackage ../development/dhall-modules/dhall-kubernetes.nix { };
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-12 06:02:53 +00:00
Prelude =
callPackage ../development/dhall-modules/Prelude.nix { };
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-12 06:02:53 +00:00
};
in
lib.fix' (lib.extends overrides packages)