mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2026-02-02 03:05:09 +01:00
feat: rewrite how nixlets work
This commit is contained in:
parent
ba81fba6b2
commit
0cde19e51f
36 changed files with 494 additions and 125 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
configMaps."${values.uniqueName}-config" = {
|
||||
data = {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
values,
|
||||
nixlet,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = let
|
||||
# switch to a StatefulSet if we don't use an external storage configuration
|
||||
type =
|
||||
|
|
|
|||
6
nixlets/attic/nixlet.nix
Normal file
6
nixlets/attic/nixlet.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "attic";
|
||||
version = "0.0.1";
|
||||
description = "Multi-tenant Nix Binary Cache";
|
||||
defaultProject = "attic";
|
||||
}
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
values,
|
||||
nixlet,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
persistentVolumeClaims."${values.uniqueName}-data".spec = lib.mkIf (!values.externalStorage) {
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
services."${values.uniqueName}" = {
|
||||
spec = {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
lib,
|
||||
utils,
|
||||
project,
|
||||
nixlet,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
with nixlet; {
|
||||
# for some basic values see https://github.com/helm/examples/blob/4888ba8fb8180dd0c36d1e84c1fcafc6efd81532/charts/hello-world/values.yaml
|
||||
options = {
|
||||
replicaCount = mkOption {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
configMaps."${values.uniqueName}-config" = {
|
||||
data = {
|
||||
|
|
|
|||
6
nixlets/mosquitto/nixlet.nix
Normal file
6
nixlets/mosquitto/nixlet.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "mosquitto";
|
||||
version = "0.0.1";
|
||||
description = "An open source MQTT broker";
|
||||
defaultProject = "mosquitto";
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
persistentVolumeClaims."${values.uniqueName}-data".spec = {
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
services."${values.uniqueName}" = {
|
||||
spec = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
statefulSets."${values.uniqueName}".spec = {
|
||||
replicas = values.replicaCount;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
utils,
|
||||
project,
|
||||
nixlet,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
with utils;
|
||||
with nixlet; {
|
||||
# for some basic values see https://github.com/helm/examples/blob/4888ba8fb8180dd0c36d1e84c1fcafc6efd81532/charts/hello-world/values.yaml
|
||||
options = {
|
||||
replicaCount = mkOption {
|
||||
type = types.int;
|
||||
default = 1;
|
||||
};
|
||||
image = utils.mkNestedOption {
|
||||
image = mkNestedOption {
|
||||
repository = mkOption {
|
||||
type = types.str;
|
||||
default = "eclipse-mosquitto";
|
||||
|
|
@ -25,7 +27,7 @@ with lib; {
|
|||
default = "IfNotPresent";
|
||||
};
|
||||
};
|
||||
service = utils.mkNestedOption {
|
||||
service = mkNestedOption {
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 1883;
|
||||
|
|
|
|||
6
nixlets/postgres/nixlet.nix
Normal file
6
nixlets/postgres/nixlet.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "postgres";
|
||||
version = "0.0.1";
|
||||
description = "The world's most advanced open source database";
|
||||
defaultProject = "postgres";
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
persistentVolumeClaims."${values.uniqueName}-data".spec = {
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
services."${values.uniqueName}" = {
|
||||
spec = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
statefulSets."${values.uniqueName}".spec = {
|
||||
replicas = values.replicaCount;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
utils,
|
||||
project,
|
||||
nixlet,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
with utils;
|
||||
with nixlet; {
|
||||
# for some basic values see https://github.com/helm/examples/blob/4888ba8fb8180dd0c36d1e84c1fcafc6efd81532/charts/hello-world/values.yaml
|
||||
options = {
|
||||
replicaCount = mkOption {
|
||||
type = types.int;
|
||||
default = 1;
|
||||
};
|
||||
image = utils.mkNestedOption {
|
||||
image = mkNestedOption {
|
||||
repository = mkOption {
|
||||
type = types.str;
|
||||
default = "postgres";
|
||||
|
|
@ -25,7 +27,7 @@ with lib; {
|
|||
default = "IfNotPresent";
|
||||
};
|
||||
};
|
||||
service = utils.mkNestedOption {
|
||||
service = mkNestedOption {
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 5432;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
values,
|
||||
nixlet,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
deployments."${values.uniqueName}" = {
|
||||
spec = {
|
||||
|
|
|
|||
6
nixlets/surrealdb/nixlet.nix
Normal file
6
nixlets/surrealdb/nixlet.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "surrealdb";
|
||||
version = "0.0.1";
|
||||
description = "As a multi-model database, SurrealDB enables developers to use multiple techniques to store and model data, without having to choose a method in advance";
|
||||
defaultProject = "surrealdb";
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
services."${values.uniqueName}" = {
|
||||
spec = {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
utils,
|
||||
project,
|
||||
nixlet,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
with utils;
|
||||
with nixlet; {
|
||||
# for some basic values see https://github.com/helm/examples/blob/4888ba8fb8180dd0c36d1e84c1fcafc6efd81532/charts/hello-world/values.yaml
|
||||
options = {
|
||||
replicaCount = mkOption {
|
||||
type = types.int;
|
||||
default = 1;
|
||||
};
|
||||
image = utils.mkNestedOption {
|
||||
image = mkNestedOption {
|
||||
repository = mkOption {
|
||||
type = types.str;
|
||||
default = "surrealdb/surrealdb";
|
||||
|
|
@ -25,7 +27,7 @@ with lib; {
|
|||
default = "latest";
|
||||
};
|
||||
};
|
||||
service = utils.mkNestedOption {
|
||||
service = mkNestedOption {
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8000;
|
||||
|
|
@ -35,7 +37,7 @@ with lib; {
|
|||
default = "ClusterIP";
|
||||
};
|
||||
};
|
||||
surrealdb = utils.mkNestedOption {
|
||||
surrealdb = mkNestedOption {
|
||||
log = mkOption {
|
||||
type = types.str;
|
||||
default = "info";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
values,
|
||||
nixlet,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
with nixlet; let
|
||||
tomlFormat = pkgs.formats.toml {};
|
||||
in {
|
||||
kubernetes.resources = {
|
||||
|
|
|
|||
6
nixlets/tikv/nixlet.nix
Normal file
6
nixlets/tikv/nixlet.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
name = "tikv";
|
||||
version = "0.0.1";
|
||||
description = "TiKV is an open-source, distributed, and transactional key-value database";
|
||||
defaultProject = "tikv";
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
services = {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{values, ...}: {
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
/*
|
||||
Placement Driver
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
utils,
|
||||
project,
|
||||
nixlet,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
with utils;
|
||||
with nixlet; {
|
||||
# for some basic values see https://github.com/helm/examples/blob/4888ba8fb8180dd0c36d1e84c1fcafc6efd81532/charts/hello-world/values.yaml
|
||||
options = {
|
||||
pd = utils.mkNestedOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue