mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-11 17:50:06 +01:00
chore: add initial nix-kubernetes template
This commit is contained in:
parent
6bd319fbe9
commit
7cd71e7537
8 changed files with 425 additions and 2 deletions
34
flake.nix
34
flake.nix
|
|
@ -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";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue