mirror of
https://github.com/dhall-lang/dhall-kubernetes.git
synced 2024-09-10 23:15:30 +03:00
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:
parent
f4bf4b9ddf
commit
f991aecf91
35
README.md
35
README.md
@ -306,6 +306,41 @@ in
|
|||||||
|
|
||||||
## Development
|
## 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
|
### Adding a new Kubernetes releases
|
||||||
|
|
||||||
To add a new supported release, run:
|
To add a new supported release, run:
|
||||||
|
9
nix/dhall-haskell.json
Normal file
9
nix/dhall-haskell.json
Normal 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
|
||||||
|
}
|
@ -13,7 +13,7 @@ let
|
|||||||
|
|
||||||
cd $out
|
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 =
|
make-dhall-kubernetes-package =
|
||||||
@ -120,28 +120,21 @@ let
|
|||||||
let
|
let
|
||||||
previous = old.overrides or (_: _: {});
|
previous = old.overrides or (_: _: {});
|
||||||
|
|
||||||
packages = pkgsNew.haskell.lib.packageSourceOverrides {
|
extension = haskellPackagesNew: haskellPackagesOld: {
|
||||||
dhall-kubernetes-generator = ../dhall-kubernetes-generator;
|
dhall-openapi =
|
||||||
};
|
let
|
||||||
|
json =
|
||||||
|
builtins.fromJSON (builtins.readFile ./dhall-haskell.json);
|
||||||
|
|
||||||
packagesFromDirectory = pkgsNew.haskell.lib.packagesFromDirectory {
|
dhall-haskell = ~/path/to/dhall-haskell;
|
||||||
directory = ./haskell;
|
|
||||||
};
|
|
||||||
|
|
||||||
manual = haskellPackagesNew: haskellPackagesOld: {
|
in
|
||||||
dhall =
|
(import "${dhall-haskell}/default.nix").dhall-openapi;
|
||||||
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.dhall_1_33_0;
|
|
||||||
|
|
||||||
dhall-json = haskellPackagesOld.dhall-json_1_7_0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
pkgsNew.lib.fold pkgsNew.lib.composeExtensions (_: _: {})
|
pkgsNew.lib.composeExtensions (_: _: {}) extension;
|
||||||
[ previous
|
|
||||||
packages
|
|
||||||
# packagesFromDirectory
|
|
||||||
manual
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
products = {
|
products = {
|
||||||
inherit (pkgs.haskellPackages) dhall-kubernetes-generator;
|
|
||||||
|
|
||||||
# Derivation that trivially depends on the input source code revision.
|
# Derivation that trivially depends on the input source code revision.
|
||||||
# As this is included in the "dhall-lang" aggregate, it forces every
|
# As this is included in the "dhall-lang" aggregate, it forces every
|
||||||
# commit to have a corresponding GitHub status check, even if the
|
# commit to have a corresponding GitHub status check, even if the
|
||||||
|
Loading…
Reference in New Issue
Block a user