mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
Use nixhelm as input; rework AT interface
In 0fb8e4d
I forgot that flake input-following exists. I don't _have_ to
ship nixhelm myself, but I do need to include it so I can stop bundling
data for an oudated AT version.
This commit is contained in:
parent
ac32bb76ca
commit
2af6a9f42e
7 changed files with 208 additions and 17 deletions
|
@ -60,7 +60,10 @@ Add Turboprop to your flake's inputs, along with flake-utils and nixhelm:
|
|||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixhelm.url = "github:farcaller/nixhelm";
|
||||
turboprop.url = "sourcehut:~goorzhel/turboprop";
|
||||
turboprop = {
|
||||
url = "sourcehut:~goorzhel/turboprop";
|
||||
inputs.nixhelm.follows = "nixhelm";
|
||||
};
|
||||
};
|
||||
<...>
|
||||
}
|
||||
|
|
187
flake.lock
187
flake.lock
|
@ -18,6 +18,41 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "flake-utils",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-utils_3": {
|
||||
"inputs": {
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"haumea": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -39,6 +74,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-github-actions": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixhelm",
|
||||
"poetry2nix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1698974481,
|
||||
"narHash": "sha256-yPncV9Ohdz1zPZxYHQf47S8S0VrnhV7nNhCawY46hDA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"rev": "4bb5e752616262457bc7ca5882192a564c0472d2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-kube-generators": {
|
||||
"locked": {
|
||||
"lastModified": 1708155396,
|
||||
|
@ -54,6 +111,44 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-kube-generators_2": {
|
||||
"locked": {
|
||||
"lastModified": 1702548734,
|
||||
"narHash": "sha256-2pREm/iZ1FyyFuukt/B3nud2NYTUImy5vqc2tESoP9g=",
|
||||
"owner": "farcaller",
|
||||
"repo": "nix-kube-generators",
|
||||
"rev": "fb7a70a8cd76aa76fdf3281123582693aec486a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "farcaller",
|
||||
"repo": "nix-kube-generators",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixhelm": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nix-kube-generators": "nix-kube-generators_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"poetry2nix": "poetry2nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708304289,
|
||||
"narHash": "sha256-NSM4+RFRDhe+EZtdP8eEpBmaZtXaIDorcqdqYDur3MA=",
|
||||
"owner": "farcaller",
|
||||
"repo": "nixhelm",
|
||||
"rev": "5b0db2c7db259e0b4d3abb281e7c51111e2921bc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "farcaller",
|
||||
"repo": "nixhelm",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1701669346,
|
||||
|
@ -69,11 +164,37 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"poetry2nix": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_3",
|
||||
"nix-github-actions": "nix-github-actions",
|
||||
"nixpkgs": [
|
||||
"nixhelm",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_4",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1702365004,
|
||||
"narHash": "sha256-IRFvmyP1uk1hchRVxaXTqu6YoZCvMM/NVtUf2hD2Tag=",
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"rev": "c12ac880114d52a3cad5fa02b00f2e2090e89982",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"haumea": "haumea",
|
||||
"nix-kube-generators": "nix-kube-generators",
|
||||
"nixhelm": "nixhelm",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
|
@ -91,6 +212,72 @@
|
|||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_4": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "systems",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixhelm",
|
||||
"poetry2nix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1699786194,
|
||||
"narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
16
flake.nix
16
flake.nix
|
@ -9,6 +9,10 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
|
||||
nixhelm = {
|
||||
url = "github:farcaller/nixhelm";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
|
@ -17,6 +21,7 @@
|
|||
haumea,
|
||||
nix-kube-generators,
|
||||
nixpkgs,
|
||||
nixhelm,
|
||||
}:
|
||||
{
|
||||
templates.default = {
|
||||
|
@ -28,6 +33,7 @@
|
|||
pkgs = import nixpkgs {inherit system;};
|
||||
kubelib = nix-kube-generators.lib {inherit pkgs;};
|
||||
lib = import ./lib {inherit kubelib pkgs;};
|
||||
nixhelmCharts = nixhelm.chartsDerivations.${system};
|
||||
|
||||
mkCharts = src:
|
||||
haumea.lib.load {
|
||||
|
@ -46,12 +52,16 @@
|
|||
})
|
||||
.mkDerivation;
|
||||
|
||||
app-template = lib.app-template;
|
||||
app-template = import ./lib/app-template.nix {
|
||||
builders = lib.builders;
|
||||
charts = nixhelmCharts;
|
||||
inherit pkgs;
|
||||
};
|
||||
|
||||
inherit mkCharts;
|
||||
mkChartsWithNixhelm = src: nh:
|
||||
mkChartsWithNixhelm = src:
|
||||
pkgs.lib.attrsets.recursiveUpdate
|
||||
nh.chartsDerivations.${system}
|
||||
nixhelmCharts
|
||||
(mkCharts src);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{
|
||||
builders,
|
||||
fetchers,
|
||||
charts,
|
||||
pkgs,
|
||||
}: let
|
||||
bundledATChart = fetchers.helmChart (import ./chart.nix);
|
||||
in
|
||||
rec {
|
||||
}: rec {
|
||||
mkImageAttrs = image:
|
||||
with builtins; let
|
||||
vals = pkgs.lib.strings.splitString ":" image;
|
||||
|
@ -41,7 +38,7 @@ in
|
|||
namespace,
|
||||
name,
|
||||
mainImage,
|
||||
appTemplateChart ? bundledATChart,
|
||||
appTemplateChart ? charts.bjw-s.app-template,
|
||||
values ? {},
|
||||
kubeVersion ? pkgs.kubernetes.version,
|
||||
apiVersions ? [],
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
repo = "https://bjw-s.github.io/helm-charts/";
|
||||
chart = "app-template";
|
||||
version = "2.3.0";
|
||||
chartHash = "sha256-J0hWCLYyeVIiIJcFOCt5Oq0IubzFw3Bs61TWWuVOvYU=";
|
||||
}
|
|
@ -4,7 +4,6 @@
|
|||
}: rec {
|
||||
builders = import ./builders.nix {inherit kubelib pkgs;};
|
||||
fetchers = import ./fetchers.nix {inherit kubelib pkgs;};
|
||||
app-template = import ./app-template {inherit builders fetchers pkgs;};
|
||||
|
||||
parseYAMLsFile = p: kubelib.fromYAML (builtins.readFile p);
|
||||
parseYAMLFile = p: builtins.head (parseYAMLsFile p);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
turboprop = {
|
||||
url = "sourcehut:~goorzhel/turboprop";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixhelm.follows = "nixhelm";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue