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
|
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>`.
|
A personal access token requires this format instead: `PRIVATE-TOKEN: <your token>`.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
The script only uploads a version once. If the version already exists it will skip that Nixlet.
|
The script only uploads a version once. If the version already exists it will skip that Nixlet.
|
||||||
|
|
||||||
## General
|
## General
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ with lib; rec {
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
file
|
file
|
||||||
({...}: {
|
(_: {
|
||||||
# pass through all args to the values.nix module
|
# pass through all args to the values.nix module
|
||||||
config =
|
config =
|
||||||
rawValues
|
rawValues
|
||||||
|
|
@ -59,41 +59,42 @@ with lib; rec {
|
||||||
eval = {
|
eval = {
|
||||||
system,
|
system,
|
||||||
project ? defaultProject,
|
project ? defaultProject,
|
||||||
overrides ? ({...}: {}),
|
overrides ? (_: {}),
|
||||||
values ? {},
|
values ? {},
|
||||||
}:
|
}:
|
||||||
assert lib.assertMsg (project != null) "No default project set, please pass a project to the render method"; let
|
assert lib.assertMsg (project != null) "No default project set, please pass a project to the render method"; let
|
||||||
nixletArg = baseNixletArg // {inherit project;};
|
nixletArg = baseNixletArg // {inherit project;};
|
||||||
in (kubenix.evalModules.${system} {
|
in
|
||||||
module = {kubenix, ...}: {
|
kubenix.evalModules.${system} {
|
||||||
imports = with kubenix.modules; [
|
module = {kubenix, ...}: {
|
||||||
k8s
|
imports = with kubenix.modules; [
|
||||||
helm
|
k8s
|
||||||
docker
|
helm
|
||||||
files
|
docker
|
||||||
./secretsModule.nix
|
files
|
||||||
({...}: let
|
./secretsModule.nix
|
||||||
finalValues = mkValues "${path}/values.nix" {
|
(_: let
|
||||||
rawValues = values;
|
finalValues = mkValues "${path}/values.nix" {
|
||||||
nixlet = nixletArg;
|
rawValues = values;
|
||||||
};
|
nixlet = nixletArg;
|
||||||
in {
|
};
|
||||||
imports = [path];
|
in {
|
||||||
_module.args.nixlet =
|
imports = [path];
|
||||||
{
|
_module.args.nixlet =
|
||||||
values = finalValues;
|
{
|
||||||
}
|
values = finalValues;
|
||||||
// nixletArg;
|
}
|
||||||
})
|
// nixletArg;
|
||||||
overrides
|
})
|
||||||
];
|
overrides
|
||||||
kubenix.project = project;
|
];
|
||||||
|
kubenix.project = project;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
|
||||||
render = {
|
render = {
|
||||||
system,
|
system,
|
||||||
project ? defaultProject,
|
project ? defaultProject,
|
||||||
overrides ? ({...}: {}),
|
overrides ? (_: {}),
|
||||||
values ? {},
|
values ? {},
|
||||||
}:
|
}:
|
||||||
(nixlet.eval {
|
(nixlet.eval {
|
||||||
|
|
@ -150,6 +151,6 @@ with lib; rec {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
mkDocs = {nixlet, ...} @ opts:
|
mkDocs = opts:
|
||||||
import ./valuesDocs.nix (opts // {inherit lib;});
|
import ./valuesDocs.nix (opts // {inherit lib;});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
optionsNix = builtins.listToAttrs (
|
optionsNix = builtins.listToAttrs (
|
||||||
map (o: {
|
map (o: {
|
||||||
name = o.name;
|
inherit (o) name;
|
||||||
value = removeAttrs o [
|
value = removeAttrs o [
|
||||||
"visible"
|
"visible"
|
||||||
"internal"
|
"internal"
|
||||||
|
|
@ -76,9 +76,9 @@
|
||||||
'')
|
'')
|
||||||
+ "\n";
|
+ "\n";
|
||||||
|
|
||||||
opts = mapAttrsToList (name: opt:
|
opts =
|
||||||
optToMd opt)
|
mapAttrsToList (_name: optToMd)
|
||||||
optionsNix;
|
optionsNix;
|
||||||
markdown = concatStringsSep "\n" opts;
|
markdown = concatStringsSep "\n" opts;
|
||||||
in
|
in
|
||||||
builtins.toFile "values-doc.md" markdown
|
builtins.toFile "values-doc.md" markdown
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ with nixlet; {
|
||||||
port = 8080;
|
port = 8080;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
type = values.service.type;
|
inherit (values.service) type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ with nixlet; {
|
||||||
ports = [
|
ports = [
|
||||||
{
|
{
|
||||||
name = "mqtt";
|
name = "mqtt";
|
||||||
port = values.service.port;
|
inherit (values.service) port;
|
||||||
targetPort = 1883;
|
targetPort = 1883;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
type = values.service.type;
|
inherit (values.service) type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ with nixlet; {
|
||||||
ports = [
|
ports = [
|
||||||
{
|
{
|
||||||
name = "tcp";
|
name = "tcp";
|
||||||
port = values.service.port;
|
inherit (values.service) port;
|
||||||
targetPort = 5432;
|
targetPort = 5432;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
type = values.service.type;
|
inherit (values.service) type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
{
|
{nixlet, ...}:
|
||||||
nixlet,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with nixlet; {
|
with nixlet; {
|
||||||
kubernetes.resources = {
|
kubernetes.resources = {
|
||||||
deployments."${values.uniqueName}" = {
|
deployments."${values.uniqueName}" = {
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ with nixlet; {
|
||||||
{
|
{
|
||||||
name = "http";
|
name = "http";
|
||||||
targetPort = "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 = [
|
ports = [
|
||||||
{
|
{
|
||||||
name = "pd-server";
|
name = "pd-server";
|
||||||
port = values.pd.service.port;
|
inherit (values.pd.service) port;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "peer";
|
name = "peer";
|
||||||
|
|
@ -29,7 +29,7 @@ with nixlet; {
|
||||||
ports = [
|
ports = [
|
||||||
{
|
{
|
||||||
name = "peer";
|
name = "peer";
|
||||||
port = values.tikv.service.port;
|
inherit (values.tikv.service) port;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
type = "ClusterIP";
|
type = "ClusterIP";
|
||||||
|
|
@ -44,10 +44,10 @@ with nixlet; {
|
||||||
ports = [
|
ports = [
|
||||||
{
|
{
|
||||||
name = "server";
|
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 = [
|
imports = [
|
||||||
# import other files here
|
# import other files here
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue