1
0
Fork 0
mirror of https://git.sr.ht/~goorzhel/turboprop synced 2024-12-14 11:37:37 +00:00

Don't ship nixhelm with Turboprop

Nixhelm updates daily. Why would I ship that with my flake?
This is one area where the user really must BYOB.
This commit is contained in:
Antonio Gurgel 2023-12-06 21:42:07 -08:00
parent c33d080f5d
commit 0fb8e4d18b
4 changed files with 21 additions and 68 deletions

View file

@ -42,7 +42,8 @@ are evaluated first, usually with ordered directories like ``./services/01-servi
Then, in your flake:
#. Add Turboprop to ``inputs``.
#. Call, at minimum, ``turboprop.lib.${system}.mkDerivation {} {pname, version, src, serviceRoot}``.
#. Get an attrset of charts, either from Nixhelm or by making your own.
#. Call, at minimum, ``turboprop.lib.${system}.mkDerivation {charts} {pname, version, src, serviceRoot}``.
********
Tutorial
@ -51,13 +52,14 @@ Tutorial
Installation
============
Add Turboprop to your flake's inputs, along with flake-utils:
Add Turboprop to your flake's inputs, along with flake-utils and nixhelm:
.. code-block:: nix
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixhelm.url = "github:farcaller/nixhelm";
turboprop.url = "sourcehut:~goorzhel/turboprop";
};
<...>
@ -70,14 +72,16 @@ Next, put it to use in your flake's output:
{
<...>
outputs = {self, flake-utils, turboprop}:
outputs = {self, flake-utils, nixhelm, turboprop}:
flake-utils.lib.eachDefaultSystem (system: let
turbo = turboprop.lib.${system};
in {
packages.default = let
pname = "my-k8s-flake";
in
turbo.mkDerivation {} {
turbo.mkDerivation {
charts = nixhelm.chartsDerivations.${system}
} {
inherit pname;
version = "rolling";
src = builtins.path {
@ -305,7 +309,7 @@ Main functions
mkDerivation
------------
``{charts?, user?}
``{charts, user?}
-> {pname, version, src, serviceRoot, nsMetadata?, kubeVersion?, apiVersions?}
-> <derivation: a dir of Kustomization dirs>``
@ -313,7 +317,7 @@ The main interface to Turboprop.
The first attrset instantiates the derivation builder:
- **charts** (attrs, default: ``nixhelm.chartsDerivations.${system}``): A tree of Helm chart derivations.
- **charts** (attrs): A tree of Helm chart derivations.
- **user** (attrs, default: ``{}``): Additional data to be used by the service modules.
The second attrset specifies the derivation to build:

View file

@ -18,20 +18,6 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"haumea": {
"inputs": {
"nixpkgs": [
@ -68,43 +54,6 @@
"type": "github"
}
},
"nix-kube-generators_2": {
"locked": {
"lastModified": 1672168242,
"narHash": "sha256-HSheOSebNYt5ARW9IRab/aU0HosRE/MJOA3oBO0BKbU=",
"owner": "farcaller",
"repo": "nix-kube-generators",
"rev": "bfdfa01c6723c7adc90e4ddb4dd3c14b05890fa7",
"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"
]
},
"locked": {
"lastModified": 1701651620,
"narHash": "sha256-XFkLkQZFKJMJHY6AeRMXRJTDQ6+w4owAh1XDRkcBhRY=",
"owner": "farcaller",
"repo": "nixhelm",
"rev": "f47fa21fafff07652ea0fca8e5bc7e6f36fd58cf",
"type": "github"
},
"original": {
"owner": "farcaller",
"repo": "nixhelm",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701669346,
@ -125,7 +74,6 @@
"flake-utils": "flake-utils",
"haumea": "haumea",
"nix-kube-generators": "nix-kube-generators",
"nixhelm": "nixhelm",
"nixpkgs": "nixpkgs"
}
},

View file

@ -8,10 +8,6 @@
url = "github:nix-community/haumea/v0.2.2";
inputs.nixpkgs.follows = "nixpkgs";
};
nixhelm = {
url = "github:farcaller/nixhelm";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
};
@ -20,7 +16,6 @@
flake-utils,
haumea,
nix-kube-generators,
nixhelm,
nixpkgs,
}:
{
@ -28,12 +23,11 @@
path = ./templates/default;
description = "Example Turboprop flake";
};
} //
flake-utils.lib.eachDefaultSystem (system: let
}
// flake-utils.lib.eachDefaultSystem (system: let
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,7 +40,7 @@
in {
lib = {
mkDerivation = {
charts ? nixhelmCharts,
charts,
user ? {},
}:
(import self {

View file

@ -2,6 +2,10 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixhelm = {
url = "github:farcaller/nixhelm";
inputs.nixpkgs.follows = "nixpkgs";
};
turboprop = {
url = "sourcehut:~goorzhel/turboprop";
inputs.nixpkgs.follows = "nixpkgs";
@ -12,6 +16,7 @@
self,
nixpkgs,
flake-utils,
nixhelm,
turboprop,
}:
flake-utils.lib.eachDefaultSystem (
@ -21,7 +26,9 @@
packages.default = let
pname = "my-k8s-flake";
in
turbo.mkDerivation {} {
turbo.mkDerivation {
charts = nixhelm.chartsDerivations.${system};
} {
inherit pname;
version = "rolling";
src = builtins.path {