nixpkgs/pkgs/development/dhall-modules/dhall-packages.nix
Gabriel Gonzalez 87d5e6fc1a Change idiom for overriding Dhall package version
Before this change, a Dhall package like the Prelude would be
encoded as a record with one field per supported version.  Then
downstream packages would specify which package to override
by selecting a different record field.

The problem with that approach is that it did not provide an
easy way to override a package to a version other than the default
ones supplied by Nixpkgs.  Normally you would use the `.override`
method for this purpose, but the `override` method added by
`buildDhall{Directory,GitHub}Package` is clobbered by the
`override` method added by `callPackage` in
`./pkgs/top-level/dhall-packages.nix`.

The solution is to add a separate `.overridePackage` method which is
essentially the exact same as `.override`, except that it is no
longer clobbered by `callPackage`.  This `.overridePackage` method
allows one to override the arguments supplied to
`buildDhall{Directory,GitHub}Package`, making it easier to specify
package versions outside of the ones supported by Nixpkgs..

This also includes a change to only build one (preferred) version of each
package (instead of multiple supported versions per package), in order to
minimize the maintenance burden for the Dhall package set.
2020-11-11 11:16:04 +01:00

52 lines
2.0 KiB
Nix

{ buildDhallGitHubPackage, dhall-kubernetes, Prelude }:
let
Prelude_12_0_0 = Prelude.overridePackage {
name = "Prelude-12.0.0";
rev = "9f248138f69ee5e22192dc3d0417d5c77b189e04";
sha256 = "1gbr0376sfamp0ibhcbxz4vaxr6ipv42y42p5wyksfhz3ls9x5ph";
};
kubernetes = {
"6a47bd" = dhall-kubernetes.overridePackage {
name = "dhall-kubernetes-6a47bd";
rev = "6a47bd50c4d3984a13570ea62382a3ad4a9919a4";
sha256 = "1azqs0x2kia3xw93rfk2mdi8izd7gy9aq6qzbip32gin7dncmfhh";
};
"4ad581" = dhall-kubernetes.overridePackage {
name = "dhall-kubernetes-4ad581";
rev = "4ad58156b7fdbbb6da0543d8b314df899feca077";
sha256 = "12fm70qbhcainxia388svsay2cfg9iksc6mss0nvhgxhpypgp8r0";
};
"fee24c" = dhall-kubernetes.overridePackage {
name = "dhall-kubernetes-fee24c";
rev = "fee24c0993ba0b20190e2fdb94e386b7fb67252d";
sha256 = "11d93z8y0jzrb8dl43gqha9z96nxxqkl7cbxpz8hw8ky9x6ggayk";
};
};
in
buildDhallGitHubPackage {
name = "dhall-packages-0.11.1";
owner = "EarnestResearch";
repo = "dhall-packages";
file = "package.dhall";
rev = "8d228f578fbc7bb16c04a7c9ac8c6c7d2e13d1f7";
sha256 = "1v4y1x13lxy6cxf8xqc6sb0mc4mrd4frkxih95v9q2wxw4vkw2h7";
dependencies = [
(kubernetes."6a47bd".overridePackage { file = "1.14/package.dhall"; })
(kubernetes."6a47bd".overridePackage { file = "1.15/package.dhall"; })
(kubernetes."6a47bd".overridePackage { file = "1.16/package.dhall"; })
(kubernetes."4ad581".overridePackage { file = "types.dhall"; })
(kubernetes."fee24c".overridePackage { file = "types/io.k8s.api.core.v1.ServiceSpec.dhall"; })
(kubernetes."fee24c".overridePackage { file = "types/io.k8s.api.core.v1.PodTemplateSpec.dhall"; })
Prelude_12_0_0
(Prelude_12_0_0.overridePackage { file = "JSON/package.dhall"; })
(Prelude_12_0_0.overridePackage { file = "JSON/Type"; })
(Prelude_12_0_0.overridePackage { file = "Map/Type"; })
];
}