Switch to dhall-openapi project

The `dhall-openapi` subproject from the `dhall-haskell` repository
supersedes `dhall-kubernetes-generator`, so this change switches over
to using that project.
This commit is contained in:
Gabriel Gonzalez 2020-08-10 08:33:37 -07:00
parent f4bf4b9ddf
commit f991aecf91
4 changed files with 54 additions and 19 deletions

View File

@ -306,6 +306,41 @@ in
## Development
### Updating the `dhall-openapi` dependency
The `dhall-openapi` dependency is a subproject of the `dhall-haskell`
repository, so in order to upgrade `dhall-openapi` you need to update the
reference to the `dhall-haskell` repository.
To upgrade to the latest version of the `dhall-openapi` package, run:
```bash
nix-prefetch-git --fetch-submodules https://github.com/dhall-lang/dhall-haskell.git > ./nix/dhall-haskell.json
```
If you want to build against a local copy of `dhall-haskell`, then edit the
Nix code like this:
```diff
diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix
index 832ae1a..810e966 100644
--- a/nix/nixpkgs.nix
+++ b/nix/nixpkgs.nix
@@ -126,11 +126,7 @@ let
json =
builtins.fromJSON (builtins.readFile ./dhall-haskell.json);
- dhall-haskell = pkgsNew.fetchFromGitHub {
- owner = "dhall-lang";
- repo = "dhall-haskell";
- inherit (json) rev sha256 fetchSubmodules;
- };
+ dhall-haskell = ~/path/to/dhall-haskell;
in
(import "${dhall-haskell}/default.nix").dhall-openapi;
```
### Adding a new Kubernetes releases
To add a new supported release, run:

9
nix/dhall-haskell.json Normal file
View File

@ -0,0 +1,9 @@
{
"url": "https://github.com/dhall-lang/dhall-haskell.git",
"rev": "05b12223f8d14055494d4c0cafc5db6807282c40",
"date": "2020-08-09T16:27:04+00:00",
"sha256": "0hgw2fq8n9v24pj3z6c28adwdmxffq5rxal12xk0vb7fvad46z42",
"fetchSubmodules": true,
"deepClone": false,
"leaveDotGit": false
}

View File

@ -13,7 +13,7 @@ let
cd $out
${pkgsNew.haskellPackages.dhall-kubernetes-generator}/bin/dhall-kubernetes-generator '${spec}'
${pkgsNew.haskellPackages.dhall-openapi}/bin/openapi-to-dhall '${spec}'
'';
make-dhall-kubernetes-package =
@ -120,28 +120,21 @@ let
let
previous = old.overrides or (_: _: {});
packages = pkgsNew.haskell.lib.packageSourceOverrides {
dhall-kubernetes-generator = ../dhall-kubernetes-generator;
};
extension = haskellPackagesNew: haskellPackagesOld: {
dhall-openapi =
let
json =
builtins.fromJSON (builtins.readFile ./dhall-haskell.json);
packagesFromDirectory = pkgsNew.haskell.lib.packagesFromDirectory {
directory = ./haskell;
};
dhall-haskell = ~/path/to/dhall-haskell;
manual = haskellPackagesNew: haskellPackagesOld: {
dhall =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.dhall_1_33_0;
in
(import "${dhall-haskell}/default.nix").dhall-openapi;
dhall-json = haskellPackagesOld.dhall-json_1_7_0;
};
in
pkgsNew.lib.fold pkgsNew.lib.composeExtensions (_: _: {})
[ previous
packages
# packagesFromDirectory
manual
];
pkgsNew.lib.composeExtensions (_: _: {}) extension;
}
);
};

View File

@ -5,8 +5,6 @@
let
products = {
inherit (pkgs.haskellPackages) dhall-kubernetes-generator;
# Derivation that trivially depends on the input source code revision.
# As this is included in the "dhall-lang" aggregate, it forces every
# commit to have a corresponding GitHub status check, even if the