chore: add initial nix-kubernetes template

This commit is contained in:
technofab 2024-04-24 19:01:04 +02:00
parent 6bd319fbe9
commit 7cd71e7537
8 changed files with 425 additions and 2 deletions

View file

@ -45,12 +45,42 @@
task = {
enable = true;
alias = ",";
tasks = {};
tasks = {
"build" = {
requires.vars = ["TEMPLATE"];
cmds = [
"nix build .#{{ .TEMPLATE }}"
"install result {{ .TEMPLATE }}/template.tf.json"
];
};
"validate" = {
desc = "Validate the resulting terraform files";
deps = ["build"];
requires.vars = ["TEMPLATE"];
dir = "{{ .TEMPLATE }}";
cmds = [
"${pkgs.opentofu}/bin/tofu init"
"${pkgs.opentofu}/bin/tofu validate"
];
};
"upload-to-coder" = {
desc = "Uploads the specified template to coder";
deps = ["build" "validate"];
requires.vars = ["TEMPLATE"];
dir = "{{ .TEMPLATE }}";
interactive = true;
cmd = ''${pkgs.coder}/bin/coder templates push "{{ .TEMPLATE }}"'';
};
};
};
};
packages = {
nix-coder-image = pkgs.callPackage ./image.nix {};
nix-kubernetes = inputs.terranix.lib.terranixConfiguration {
inherit system;
modules = [./nix-kubernetes];
};
};
};
};
@ -73,5 +103,7 @@
inputs.devenv.follows = "devenv";
inputs.systems.follows = "systems";
};
terranix.url = "github:terranix/terranix";
};
}