mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2026-02-02 03:05:09 +01:00
chore: format files
This commit is contained in:
parent
012a3afb2d
commit
471cb8b7b5
11 changed files with 48 additions and 54 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,5 +1 @@
|
|||
.direnv
|
||||
.devenv
|
||||
.idea
|
||||
result
|
||||
.pre-commit-config.yaml
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ In GitLab CI this should for example be `JOB-TOKEN: $CI_JOB_TOKEN`.
|
|||
A personal access token requires this format instead: `PRIVATE-TOKEN: <your token>`.
|
||||
|
||||
!!! note
|
||||
|
||||
The script only uploads a version once. If the version already exists it will skip that Nixlet.
|
||||
|
||||
## General
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ with lib; rec {
|
|||
};
|
||||
modules = [
|
||||
file
|
||||
({...}: {
|
||||
(_: {
|
||||
# pass through all args to the values.nix module
|
||||
config =
|
||||
rawValues
|
||||
|
|
@ -59,12 +59,13 @@ with lib; rec {
|
|||
eval = {
|
||||
system,
|
||||
project ? defaultProject,
|
||||
overrides ? ({...}: {}),
|
||||
overrides ? (_: {}),
|
||||
values ? {},
|
||||
}:
|
||||
assert lib.assertMsg (project != null) "No default project set, please pass a project to the render method"; let
|
||||
nixletArg = baseNixletArg // {inherit project;};
|
||||
in (kubenix.evalModules.${system} {
|
||||
in
|
||||
kubenix.evalModules.${system} {
|
||||
module = {kubenix, ...}: {
|
||||
imports = with kubenix.modules; [
|
||||
k8s
|
||||
|
|
@ -72,7 +73,7 @@ with lib; rec {
|
|||
docker
|
||||
files
|
||||
./secretsModule.nix
|
||||
({...}: let
|
||||
(_: let
|
||||
finalValues = mkValues "${path}/values.nix" {
|
||||
rawValues = values;
|
||||
nixlet = nixletArg;
|
||||
|
|
@ -89,11 +90,11 @@ with lib; rec {
|
|||
];
|
||||
kubenix.project = project;
|
||||
};
|
||||
});
|
||||
};
|
||||
render = {
|
||||
system,
|
||||
project ? defaultProject,
|
||||
overrides ? ({...}: {}),
|
||||
overrides ? (_: {}),
|
||||
values ? {},
|
||||
}:
|
||||
(nixlet.eval {
|
||||
|
|
@ -150,6 +151,6 @@ with lib; rec {
|
|||
)
|
||||
);
|
||||
|
||||
mkDocs = {nixlet, ...} @ opts:
|
||||
mkDocs = opts:
|
||||
import ./valuesDocs.nix (opts // {inherit lib;});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
optionsNix = builtins.listToAttrs (
|
||||
map (o: {
|
||||
name = o.name;
|
||||
inherit (o) name;
|
||||
value = removeAttrs o [
|
||||
"visible"
|
||||
"internal"
|
||||
|
|
@ -76,8 +76,8 @@
|
|||
'')
|
||||
+ "\n";
|
||||
|
||||
opts = mapAttrsToList (name: opt:
|
||||
optToMd opt)
|
||||
opts =
|
||||
mapAttrsToList (_name: optToMd)
|
||||
optionsNix;
|
||||
markdown = concatStringsSep "\n" opts;
|
||||
in
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ with nixlet; {
|
|||
port = 8080;
|
||||
}
|
||||
];
|
||||
type = values.service.type;
|
||||
inherit (values.service) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ with nixlet; {
|
|||
ports = [
|
||||
{
|
||||
name = "mqtt";
|
||||
port = values.service.port;
|
||||
inherit (values.service) port;
|
||||
targetPort = 1883;
|
||||
}
|
||||
];
|
||||
type = values.service.type;
|
||||
inherit (values.service) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ with nixlet; {
|
|||
ports = [
|
||||
{
|
||||
name = "tcp";
|
||||
port = values.service.port;
|
||||
inherit (values.service) port;
|
||||
targetPort = 5432;
|
||||
}
|
||||
];
|
||||
type = values.service.type;
|
||||
inherit (values.service) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
nixlet,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{nixlet, ...}:
|
||||
with nixlet; {
|
||||
kubernetes.resources = {
|
||||
deployments."${values.uniqueName}" = {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ with nixlet; {
|
|||
{
|
||||
name = "http";
|
||||
targetPort = "http";
|
||||
port = values.service.port;
|
||||
inherit (values.service) port;
|
||||
}
|
||||
];
|
||||
type = values.service.type;
|
||||
inherit (values.service) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ with nixlet; {
|
|||
ports = [
|
||||
{
|
||||
name = "pd-server";
|
||||
port = values.pd.service.port;
|
||||
inherit (values.pd.service) port;
|
||||
}
|
||||
{
|
||||
name = "peer";
|
||||
|
|
@ -29,7 +29,7 @@ with nixlet; {
|
|||
ports = [
|
||||
{
|
||||
name = "peer";
|
||||
port = values.tikv.service.port;
|
||||
inherit (values.tikv.service) port;
|
||||
}
|
||||
];
|
||||
type = "ClusterIP";
|
||||
|
|
@ -44,10 +44,10 @@ with nixlet; {
|
|||
ports = [
|
||||
{
|
||||
name = "server";
|
||||
port = values.pd.service.port;
|
||||
inherit (values.pd.service) port;
|
||||
}
|
||||
];
|
||||
type = values.pd.service.type;
|
||||
inherit (values.pd.service) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{nixlet, ...}: {
|
||||
{...}: {
|
||||
imports = [
|
||||
# import other files here
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue