Nixpkgs support for dhall-to-nixpkgs
The motivation for this change is to enable a new Dhall command-line utility called `dhall-to-nixpkgs` which converts Dhall packages to buildable Nix packages. You can think of `dhall-to-nixpkgs` as the Dhall analog of `cabal2nix`. You can find the matching pull request for `dhall-to-nixpkgs` here: https://github.com/dhall-lang/dhall-haskell/pull/1826 The two main changes required to support `dhall-to-nixpkgs` are: * Two new `buildDhall{Directory,GitHub}Package` utilities are added `dhall-to-nixpkgs` uses these in the generated output * `pkgs.dhallPackages` now selects a default version for each package using the `prefer` utility All other versions are still buildable via a `passthru` attribute
This commit is contained in:
committed by
Profpatsch
parent
2ee84ca8e2
commit
459cf94991
@@ -1,29 +1,16 @@
|
||||
{ buildDhallPackage, fetchFromGitHub, lib }:
|
||||
{ buildDhallGitHubPackage, lib }:
|
||||
|
||||
let
|
||||
makeDhallKubernetes =
|
||||
version:
|
||||
lib.makeOverridable
|
||||
( { rev
|
||||
, sha256
|
||||
, file ? "package.dhall"
|
||||
}:
|
||||
buildDhallPackage {
|
||||
name = "dhall-kubernetes-${version}";
|
||||
version: { rev, sha256 }:
|
||||
buildDhallGitHubPackage {
|
||||
name = "dhall-kubernetes-${version}";
|
||||
owner = "dhall-lang";
|
||||
repo = "dhall-kubernetes";
|
||||
file = "package.dhall";
|
||||
|
||||
code =
|
||||
let
|
||||
src = fetchFromGitHub {
|
||||
owner = "dhall-lang";
|
||||
repo = "dhall-kubernetes";
|
||||
|
||||
inherit rev sha256;
|
||||
};
|
||||
|
||||
in
|
||||
"${src}/${file}";
|
||||
}
|
||||
);
|
||||
inherit rev sha256;
|
||||
};
|
||||
|
||||
in
|
||||
lib.mapAttrs makeDhallKubernetes {
|
||||
|
||||
Reference in New Issue
Block a user