chore: format files

This commit is contained in:
technofab 2025-12-18 13:42:14 +01:00
parent 012a3afb2d
commit 471cb8b7b5
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
11 changed files with 48 additions and 54 deletions

4
.gitignore vendored
View file

@ -1,5 +1 @@
.direnv
.devenv
.idea
result result
.pre-commit-config.yaml

View file

@ -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

View file

@ -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;});
} }

View file

@ -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

View file

@ -10,7 +10,7 @@ with nixlet; {
port = 8080; port = 8080;
} }
]; ];
type = values.service.type; inherit (values.service) type;
}; };
}; };
}; };

View file

@ -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;
}; };
}; };
}; };

View file

@ -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;
}; };
}; };
}; };

View file

@ -1,8 +1,4 @@
{ {nixlet, ...}:
nixlet,
lib,
...
}:
with nixlet; { with nixlet; {
kubernetes.resources = { kubernetes.resources = {
deployments."${values.uniqueName}" = { deployments."${values.uniqueName}" = {

View file

@ -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;
}; };
}; };
}; };

View file

@ -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;
}; };
}; };
}; };

View file

@ -1,4 +1,4 @@
{nixlet, ...}: { {...}: {
imports = [ imports = [
# import other files here # import other files here
]; ];