From 403214345899cf96ebb17e8dfda065c0101da476 Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 15:35:18 +0300 Subject: [PATCH 01/10] feat: Add spell checking using codespell --- treefmt.toml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/treefmt.toml b/treefmt.toml index 1b767f2..e9ceef3 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -7,10 +7,9 @@ includes = [ "*.nix"] [formatter.shell] command = "shfmt" options = [ - "-i", - "2", # indent 2 - "-s", # simplify the code - "-w", # write back to the file + "--indent=2", + "--simplify", + "--write", ] includes = ["*.sh"] @@ -31,3 +30,7 @@ includes = [ "*.yaml", "*.yml", ] + +[formatter.spelling] +command = "codespell" +includes = ["*.md"] From 7ef43b8029e24a4d40ab0a35bad97044183a14ff Mon Sep 17 00:00:00 2001 From: Sagi Sarussi <39622904+tuxiqae@users.noreply.github.com> Date: Sat, 21 Oct 2023 12:43:34 +0000 Subject: [PATCH 02/10] Create treefmt.yml --- .github/workflows/treefmt.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/treefmt.yml diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml new file mode 100644 index 0000000..9297cb7 --- /dev/null +++ b/.github/workflows/treefmt.yml @@ -0,0 +1,15 @@ +name: treefmt +on: + pull_request: + push: + branches: main +jobs: + formatter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: cachix/install-nix-action@v12 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: treefmt + run: nix-shell --run "treefmt --fail-on-change --no-cache" From 261d3c85098e2e2f0c642a0c2d6f3887e43fb97f Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 15:49:44 +0300 Subject: [PATCH 03/10] Fix action rules --- .github/workflows/treefmt.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index 9297cb7..f64e909 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -1,8 +1,9 @@ name: treefmt on: pull_request: + branches: [main] push: - branches: main + branches: [main] jobs: formatter: runs-on: ubuntu-latest From 6246564e2254fa3c8383536687d3d814bc8d0d88 Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 15:52:17 +0300 Subject: [PATCH 04/10] Fix action rules 2 --- .github/workflows/treefmt.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index f64e909..8c095eb 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -1,9 +1,5 @@ name: treefmt -on: - pull_request: - branches: [main] - push: - branches: [main] +on: [push, pull_request] jobs: formatter: runs-on: ubuntu-latest From 6396ffda5e2a1e2cf0ccfa47f0cb553d215e4a5c Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:22:58 +0300 Subject: [PATCH 05/10] Upgrade actions --- .github/workflows/treefmt.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index 8c095eb..5521dea 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -4,8 +4,8 @@ jobs: formatter: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: cachix/install-nix-action@v12 + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v23 with: nix_path: nixpkgs=channel:nixos-unstable - name: treefmt From 8ddf9e7f6d228a5559c933488769a9833debcac8 Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:30:26 +0300 Subject: [PATCH 06/10] Fix command --- .github/workflows/treefmt.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index 5521dea..2bed8ba 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -9,4 +9,13 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable - name: treefmt - run: nix-shell --run "treefmt --fail-on-change --no-cache" + run: nix-shell \ + --package treefmt \ + --package nixpkgs-fmt \ + --package shfmt \ + --package shellcheck \ + --package black \ + --package nodePackages.prettier \ + --package codespell \ + --command "treefmt --fail-on-change --no-cache" + From 9416cee4089bff545ab9c7ad343f0ebdd69f33eb Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:32:33 +0300 Subject: [PATCH 07/10] Fix command 2 --- .github/workflows/treefmt.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index 2bed8ba..d0347d3 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -9,13 +9,12 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable - name: treefmt - run: nix-shell \ - --package treefmt \ - --package nixpkgs-fmt \ - --package shfmt \ - --package shellcheck \ - --package black \ - --package nodePackages.prettier \ - --package codespell \ + run: nix-shell + --package treefmt + --package nixpkgs-fmt + --package shfmt + --package shellcheck + --package black + --package nodePackages.prettier + --package codespell --command "treefmt --fail-on-change --no-cache" - From e88aa5b4d069f73686a82efa79d90ae3fba84d0d Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:35:41 +0300 Subject: [PATCH 08/10] Fix command 3 --- .github/workflows/treefmt.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/treefmt.yml b/.github/workflows/treefmt.yml index d0347d3..82de6f6 100644 --- a/.github/workflows/treefmt.yml +++ b/.github/workflows/treefmt.yml @@ -10,11 +10,12 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - name: treefmt run: nix-shell - --package treefmt - --package nixpkgs-fmt - --package shfmt - --package shellcheck - --package black - --package nodePackages.prettier - --package codespell + --packages + treefmt + nixpkgs-fmt + shfmt + shellcheck + black + nodePackages.prettier + codespell --command "treefmt --fail-on-change --no-cache" From 1dc3f57eb5bdb3e30d68ab919a7399b162dd384e Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:40:33 +0300 Subject: [PATCH 09/10] Checking that it works --- README.md | 1 - Taskfile.yml | 2 +- config.yaml | 6 +- content/_index.md | 12 +- content/documentation/_index.md | 6 +- content/documentation/flakes.md | 27 +-- content/documentation/functions.md | 15 +- content/documentation/getting-started.md | 14 +- .../getting-startet-with-nix-flakes.md | 8 +- content/documentation/modules.md | 10 +- content/documentation/terranix-vs-hcl.md | 10 +- content/documentation/what-is-terranix.md | 3 +- content/news/_index.md | 1 - content/news/logo.md | 11 +- content/news/matrix.md | 8 +- content/news/release-2.4.0.md | 6 +- content/news/release-2.5.0.md | 2 +- content/news/release-2.5.1.md | 2 +- content/news/release-2.5.2.md | 4 +- content/news/release-2.5.3.md | 2 +- content/news/release-2.5.4.md | 2 +- content/news/release-2.5.5.md | 2 +- content/news/release-2.7.0.md | 4 +- content/options/_index.md | 2 +- content/options/core-options/index.md | 6 +- .../options/core-options/options_export.json | 182 ++++-------------- content/options/hcloud-options/index.md | 4 +- .../hcloud-options/options_export.json | 128 ++---------- content/options/json_converter.sh | 4 +- static/manifest.json | 2 +- 30 files changed, 138 insertions(+), 348 deletions(-) diff --git a/README.md b/README.md index db70a11..fc598b9 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,3 @@ terranix-doc-json \ ``` `--path` is to shorten the url, just run without it, and you'll see. - diff --git a/Taskfile.yml b/Taskfile.yml index b143808..30336c5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" vars: SERVER: robi.private diff --git a/config.yaml b/config.yaml index c7facaf..2a2f2e7 100644 --- a/config.yaml +++ b/config.yaml @@ -36,14 +36,14 @@ menu: weight: 2 identifier: "news" - - name: "documentation" + - name: "documentation" url: "/documentation/" identifier: "documentation" weight: 3 title: RTF(riendly)M - - name: "options" + - name: "options" url: "/options" identifier: "options" weight: 4 - title: optinonated terranix modules \ No newline at end of file + title: optinonated terranix modules diff --git a/content/_index.md b/content/_index.md index 5a70b73..b6f09ed 100644 --- a/content/_index.md +++ b/content/_index.md @@ -13,16 +13,16 @@ files. ## Features -* Using terranix is very similar to use terraform, you can use the +- Using terranix is very similar to use terraform, you can use the [terraform reference material](https://www.terraform.io/docs/providers/index.html) without much hassle. -* The full power of the nix language (map, filter, reduce, ... ) -* The full power of the module system of NixOS -* The full power of all the tooling in `pkgs` of NixOS (fetchgit,fetchurl,writers, ...) -* Documentation generation from `config.nix` as json or man page. +- The full power of the nix language (map, filter, reduce, ... ) +- The full power of the module system of NixOS +- The full power of all the tooling in `pkgs` of NixOS (fetchgit,fetchurl,writers, ...) +- Documentation generation from `config.nix` as json or man page. ## Community - Join via matrix at `#terranix:terranix.org`. - Write issues on [github](https://github.com/terranix/terranix/issues) -- Create pull requests on [github](https://github.com/terranix/terranix/pulls) \ No newline at end of file +- Create pull requests on [github](https://github.com/terranix/terranix/pulls) diff --git a/content/documentation/_index.md b/content/documentation/_index.md index 88b23c9..27ad243 100644 --- a/content/documentation/_index.md +++ b/content/documentation/_index.md @@ -3,9 +3,5 @@ title: documentation --- terranix is a json generator using Nix and NixOS modules -intended to generate +intended to generate [terraform json](https://www.terraform.io/docs/configuration/syntax-json.html). - - - - diff --git a/content/documentation/flakes.md b/content/documentation/flakes.md index d0a0cae..90cf0de 100644 --- a/content/documentation/flakes.md +++ b/content/documentation/flakes.md @@ -3,7 +3,7 @@ title: terranix via nix flakes draft: false order: 90 summary: | - all about terranix and nix flakes + all about terranix and nix flakes letter: g --- @@ -17,6 +17,7 @@ If you don't know what [NixOS](https://nixos.org) or ## Using terranix via flakes You can check out an example using the `template` feature of nix flakes. + ```shell nix flake init --template github:terranix/terranix-examples ``` @@ -26,6 +27,7 @@ nix flake init --template github:terranix/terranix-examples You can render the `config.tf.json` using the `lib.terranixConfiguration`. Here is a minimal `flake.nix` + ```nix { inputs.terranix.url = "github:terranix/terranix"; @@ -41,11 +43,11 @@ Here is a minimal `flake.nix` }; } ``` + You can run `nix build -o config.tf.json`, which should create a `config.tf.json` in your current folder. Now you are ready to run `terraform`. - ### Import terranix modules You can include a terranix module like a `nixosModule` with flakes. @@ -55,9 +57,9 @@ inputs.github.url = "github:terranix/terranix-module-github"; ... terraformConfiguration = terranix.lib.terranixConfiguration{ inherit system; - modules = [ + modules = [ github.terranixModule - ./config.nix + ./config.nix ]; }; ``` @@ -73,8 +75,8 @@ nix flake init --template "github:terranix/terranix-examples#module" terranix modules should obey the following output structure: -* `terranixModules.` -* `terranixModule` : contains all `terranixModules` combined of the given flake. +- `terranixModules.` +- `terranixModule` : contains all `terranixModules` combined of the given flake. ### using terranixOptions @@ -85,6 +87,7 @@ which can be easily queried by [jq](https://stedolan.github.io/jq/manual/). For example you can pull the options.json of the [terranix github module](https://github.com/terranix/terranix-module-github) + ```shell curl https://raw.githubusercontent.com/terranix/terranix-module-github/main/options.json | \ jq 'to_entries | .[] | @@ -108,14 +111,14 @@ you can make use of the `terranixConfigurationAst` or the `terranixOptionsAst` f Here is a simple example of using `nix repl` and `terranixConfigurationAst`. ```nix -nix-repl> terranixAst = (builtins.getFlake "github:terranix/terranix").lib.terranixConfigurationAst -nix-repl> terranix = terranixAst { +nix-repl> terranixAst = (builtins.getFlake "github:terranix/terranix").lib.terranixConfigurationAst +nix-repl> terranix = terranixAst { system = "x86_64-linux"; - modules = [{ - resource.local_file = { - content = "yolo"; + modules = [{ + resource.local_file = { + content = "yolo"; filename = "./example"; - }; + }; }]; } nix-repl> terranix.config.resource.local_file diff --git a/content/documentation/functions.md b/content/documentation/functions.md index 22f1caf..b622d48 100644 --- a/content/documentation/functions.md +++ b/content/documentation/functions.md @@ -4,8 +4,8 @@ order: 40 summary: Some terranix functions which are useful including examples. letter: f feature: -- /documentation/modules.md -- /documentation/resources.md + - /documentation/modules.md + - /documentation/resources.md --- Here are some Functions which are useful. @@ -41,13 +41,12 @@ in Useful to create multiple resources, contains a lot of similar data, out of a small set of information that differ. -* `map` -: map a list to another list. -* `zipAttrs` -: Merge sets of attributes and combine each attribute value in to a list. +- `map` + : map a list to another list. +- `zipAttrs` + : Merge sets of attributes and combine each attribute value in to a list. - -The following Example shows how to create 3 S3-buckets with similar configuration. +The following Example shows how to create 3 S3-buckets with similar configuration. ```nix { lib, ... }: diff --git a/content/documentation/getting-started.md b/content/documentation/getting-started.md index 02af000..f26c85e 100644 --- a/content/documentation/getting-started.md +++ b/content/documentation/getting-started.md @@ -3,13 +3,13 @@ title: Getting Started draft: false order: 10 summary: | - You know nix and terraform and want to see how to terranix - works? This the place to start. + You know nix and terraform and want to see how to terranix + works? This the place to start. letter: g feature: -- /documentation/what-is-terranix.md -- /documentation/terranix-vs-hcl.md -- /documentation/modules.md + - /documentation/what-is-terranix.md + - /documentation/terranix-vs-hcl.md + - /documentation/modules.md --- Let's have a quick overview on how you would use terranix. @@ -31,7 +31,7 @@ which holds your terranix and terraform setup. { pkgs ? import { } }: let hcloud_api_token = "`${pkgs.pass}/bin/pass development/hetzner.com/api-token`"; - + terraform = pkgs.writers.writeBashBin "terraform" '' export TF_VAR_hcloud_api_token=${hcloud_api_token} ${pkgs.terraform_0_15}/bin/terraform "$@" @@ -71,7 +71,7 @@ and run `terraform apply` to let terraform do it's magic. ```shell -terranix config.nix > config.tf.json +terranix config.nix > config.tf.json terraform init && terraform apply ``` diff --git a/content/documentation/getting-startet-with-nix-flakes.md b/content/documentation/getting-startet-with-nix-flakes.md index 397a656..730ee8a 100644 --- a/content/documentation/getting-startet-with-nix-flakes.md +++ b/content/documentation/getting-startet-with-nix-flakes.md @@ -3,21 +3,21 @@ title: Getting Started with nix flake draft: false order: 11 summary: | - You know nix flakes and terraform and want to see how to terranix - works with nix flakes? This the place to start. + You know nix flakes and terraform and want to see how to terranix + works with nix flakes? This the place to start. letter: g --- [nix flakes](https://nixos.wiki/wiki/Flakes) make dependency management of modules and packages much easier. -Deeper look at terranix and nix flakes is done in the +Deeper look at terranix and nix flakes is done in the [flake chapter]({{< ref "documentation/flakes.md" >}}) ## nix build - Here is a minimal `flake.nix` + ```nix { inputs.terranix.url = "github:terranix/terranix"; diff --git a/content/documentation/modules.md b/content/documentation/modules.md index c845691..affefc7 100644 --- a/content/documentation/modules.md +++ b/content/documentation/modules.md @@ -3,10 +3,10 @@ title: Modules order: 80 letter: m summary: | - The NixOS module system the real power behind terranix. + The NixOS module system the real power behind terranix. feature: -- /documentation/functions.md -- /documentation/terranix-vs-hcl.md + - /documentation/functions.md + - /documentation/terranix-vs-hcl.md --- The real power behind NixOS and terranix, @@ -94,5 +94,5 @@ config = mkAssert (cfg.parameter != "fail") "parameter is set to fail!" { ## provide terranix modules using nix flakes -Have a look at -[the flake documentation]({{< ref "flakes.md#writing-terranix-modules" >}}) \ No newline at end of file +Have a look at +[the flake documentation]({{< ref "flakes.md#writing-terranix-modules" >}}) diff --git a/content/documentation/terranix-vs-hcl.md b/content/documentation/terranix-vs-hcl.md index 67cc3e7..fcb39a7 100644 --- a/content/documentation/terranix-vs-hcl.md +++ b/content/documentation/terranix-vs-hcl.md @@ -4,9 +4,9 @@ order: 30 summary: Syntax differences between terranix and HCL letter: t feature: -- /documentation/functions.md -- /documentation/modules.md -- /documentation/getting-started.md + - /documentation/functions.md + - /documentation/modules.md + - /documentation/getting-started.md --- **HCL** is the language of terraform. @@ -40,10 +40,11 @@ resource."aws_instance"."web" = { ## references -In **HCL** you can only reference variable outputs. +In **HCL** you can only reference variable outputs. But in terranix, because it is nix, you can basically reference everything. For example if you have a resource and you want to reuse its parameters: + ```nix resource.hcloud_server.myserver = { name = "node1"; @@ -62,7 +63,6 @@ resource.hcloud_server.myotherserver = { }; ``` - Or the terranix way: ```nix diff --git a/content/documentation/what-is-terranix.md b/content/documentation/what-is-terranix.md index 2d6a208..bc82183 100644 --- a/content/documentation/what-is-terranix.md +++ b/content/documentation/what-is-terranix.md @@ -36,6 +36,7 @@ A huge list of providers is available on #### Definition of multiple identical providers Here is an example of how you would [define multiple providers of the same kind](https://www.terraform.io/language/syntax/json#provider-blocks) + ```nix provider.aws = [{ region = "us-east-1"; @@ -62,5 +63,3 @@ so handle secrets always with care! terranix is a tool that enables you to render the `config.tf.json` file. It uses the NixOS module system and gives you tools like `terranix-doc-man` and `terranix-doc-json` to generate documentation of terranix modules. - - diff --git a/content/news/_index.md b/content/news/_index.md index 5face7c..2edb12c 100644 --- a/content/news/_index.md +++ b/content/news/_index.md @@ -1,4 +1,3 @@ --- title: news --- - diff --git a/content/news/logo.md b/content/news/logo.md index 8a521a4..dc134f8 100644 --- a/content/news/logo.md +++ b/content/news/logo.md @@ -2,24 +2,23 @@ title: new page layout date: 2021-10-20 summary: | - It took quite a while, but finally the new layout is acceptable. - terranix became a logo. + It took quite a while, but finally the new layout is acceptable. + terranix became a logo. --- -It took me a while to change the layout of terranix, +It took me a while to change the layout of terranix, but it's here now. -The layout was heavily inspired by +The layout was heavily inspired by [hack.css/after dark](https://after-dark.habd.as/feature/). ## the logo The new logo -{{% figure +{{% figure src=https://raw.githubusercontent.com/terranix/terranix-artwork/main/terranix-logo.svg width=400px %}} was created by [Gerald Wagner](https://de.linkedin.com/in/gerald-wagner-graphic-programming), and is licensed under [MIT](https://github.com/terranix/terranix-artwork/blob/main/LICENSE). - diff --git a/content/news/matrix.md b/content/news/matrix.md index b31ed9b..ef5b743 100644 --- a/content/news/matrix.md +++ b/content/news/matrix.md @@ -9,7 +9,7 @@ Looking forward to talk to you! All you need is a matrix client and an account. If you don't know where to start, just use element and create an account on `matrix.org`. -Many thanks to -[0x4A6F](https://github.com/0x4A6F), -[Mic92](https://github.com/Mic92) and -[grahamc](https://github.com/grahamc) \ No newline at end of file +Many thanks to +[0x4A6F](https://github.com/0x4A6F), +[Mic92](https://github.com/Mic92) and +[grahamc](https://github.com/grahamc) diff --git a/content/news/release-2.4.0.md b/content/news/release-2.4.0.md index ff8ddb3..95e22a3 100644 --- a/content/news/release-2.4.0.md +++ b/content/news/release-2.4.0.md @@ -6,19 +6,19 @@ summary: version 2.4.0 with flake support is finally here. Version [2.4.0](https://github.com/terranix/terranix/releases/tag/2.4.0) is finally released. -It took a while but terranix finally +It took a while but terranix finally is provides nix flake support. Examples and templates will follow in the coming weeks. -Thanks to +Thanks to [l5r](https://github.com/l5r) [loafofpiecrust](https://github.com/loafofpiecrust) [Mic92](https://github.com/Mic92) [terlar](https://github.com/terlar) for your input and help on this release. -As special thanks to Jonathan who owned the +As special thanks to Jonathan who owned the [terranix github account](https://github.com/terranix/) and gave it to me. diff --git a/content/news/release-2.5.0.md b/content/news/release-2.5.0.md index e009bba..4ecb7da 100644 --- a/content/news/release-2.5.0.md +++ b/content/news/release-2.5.0.md @@ -7,7 +7,7 @@ summary: version 2.5.0 with some fixes and flake updates is here. Version [2.5.0](https://github.com/terranix/terranix/releases/tag/2.5.0) is released. -Thanks to +Thanks to [betaboon](https://github.com/betaboon) [KarolisL](https://github.com/KarolisL) for your input and help on this release. diff --git a/content/news/release-2.5.1.md b/content/news/release-2.5.1.md index db70bab..e9a853b 100644 --- a/content/news/release-2.5.1.md +++ b/content/news/release-2.5.1.md @@ -7,7 +7,7 @@ summary: version 2.5.1 introducing pretty json output Version [2.5.1](https://github.com/terranix/terranix/releases/tag/2.5.1) is released. -Thanks to +Thanks to [terlar](https://github.com/terlar) for your input on this release. diff --git a/content/news/release-2.5.2.md b/content/news/release-2.5.2.md index 39b5fc7..40c123d 100644 --- a/content/news/release-2.5.2.md +++ b/content/news/release-2.5.2.md @@ -7,7 +7,7 @@ summary: version 2.5.2 providing ast functions as flake Version [2.5.2](https://github.com/terranix/terranix/releases/tag/2.5.2) is released. -Thanks to +Thanks to [terlar](https://github.com/terlar) for your input on this release. @@ -16,6 +16,6 @@ for your input on this release. - add terranixConfigurationAst - add terranixOptionAst -Have a look at +Have a look at [the flakes documentation]({{< ref "documentation/flakes.md#using-terranixconfigurationast-or-terranixconfigurationast" >}}) if you want to know how to use these functions. diff --git a/content/news/release-2.5.3.md b/content/news/release-2.5.3.md index c054d91..c6498de 100644 --- a/content/news/release-2.5.3.md +++ b/content/news/release-2.5.3.md @@ -7,7 +7,7 @@ summary: version 2.5.3 adding man pages again Version [2.5.3](https://github.com/terranix/terranix/releases/tag/2.5.3) is released. -Thanks to +Thanks to [scvalex](https://github.com/scvalex) for your input on this release. diff --git a/content/news/release-2.5.4.md b/content/news/release-2.5.4.md index 3e98354..a93bf9f 100644 --- a/content/news/release-2.5.4.md +++ b/content/news/release-2.5.4.md @@ -7,7 +7,7 @@ summary: follow new flake defaults Version [2.5.4](https://github.com/terranix/terranix/releases/tag/2.5.4) is released. -Thanks to +Thanks to [Mic92](https://github.com/Mic92) for your input on this release. diff --git a/content/news/release-2.5.5.md b/content/news/release-2.5.5.md index d1c01f6..3d2fed0 100644 --- a/content/news/release-2.5.5.md +++ b/content/news/release-2.5.5.md @@ -7,7 +7,7 @@ summary: resources with empty body are filtered now. Version [2.5.5](https://github.com/terranix/terranix/releases/tag/2.5.5) is released. -Thanks to +Thanks to [abbradar](https://github.com/abbradar) for your input on this release. diff --git a/content/news/release-2.7.0.md b/content/news/release-2.7.0.md index c0c96b7..aaa492a 100644 --- a/content/news/release-2.7.0.md +++ b/content/news/release-2.7.0.md @@ -1,7 +1,7 @@ --- title: 2.7.0 release date: 2023-09-22 -summary: +summary: --- Version [2.7.0](https://github.com/terranix/terranix/releases/tag/2.7.0) @@ -15,4 +15,4 @@ for your input on this release. - add templatefile() helper - add lib.tf -- add referencable functor \ No newline at end of file +- add referenceable functor diff --git a/content/options/_index.md b/content/options/_index.md index e571cc9..e01040a 100644 --- a/content/options/_index.md +++ b/content/options/_index.md @@ -3,7 +3,7 @@ title: Options --- You can get documentation about all reachable -options in your `config.nix` by using +options in your `config.nix` by using ``` terranix-doc-man ./config.nix diff --git a/content/options/core-options/index.md b/content/options/core-options/index.md index 725140c..dd58bba 100644 --- a/content/options/core-options/index.md +++ b/content/options/core-options/index.md @@ -2,11 +2,11 @@ title: Core Options order: 1 summary: | - These options are delivered by the terranix core. - They are always available. + These options are delivered by the terranix core. + They are always available. --- These options are delivered by the terranix core. They are always available. -{{< options >}} \ No newline at end of file +{{< options >}} diff --git a/content/options/core-options/options_export.json b/content/options/core-options/options_export.json index 5adf941..4ed024c 100644 --- a/content/options/core-options/options_export.json +++ b/content/options/core-options/options_export.json @@ -9,10 +9,7 @@ ], "default": null, "description": "etcd backend\nhttps://www.terraform.io/docs/backends/types/etcd.html\n", - "loc": [ - "backend", - "etcd" - ], + "loc": ["backend", "etcd"], "readOnly": false, "type": "null or submodule" }, @@ -25,11 +22,7 @@ } ], "description": "A space-separated list of the etcd endpoints\n", - "loc": [ - "backend", - "etcd", - "endpoints" - ], + "loc": ["backend", "etcd", "endpoints"], "readOnly": false, "type": "string" }, @@ -43,11 +36,7 @@ ], "default": null, "description": "the password\n", - "loc": [ - "backend", - "etcd", - "password" - ], + "loc": ["backend", "etcd", "password"], "readOnly": false, "type": "null or string" }, @@ -60,11 +49,7 @@ } ], "description": "The path where to store the state\n", - "loc": [ - "backend", - "etcd", - "path" - ], + "loc": ["backend", "etcd", "path"], "readOnly": false, "type": "string" }, @@ -78,11 +63,7 @@ ], "default": null, "description": "the username\n", - "loc": [ - "backend", - "etcd", - "username" - ], + "loc": ["backend", "etcd", "username"], "readOnly": false, "type": "null or string" }, @@ -96,10 +77,7 @@ ], "default": null, "description": "local backend\nhttps://www.terraform.io/docs/backends/types/local.html\n", - "loc": [ - "backend", - "local" - ], + "loc": ["backend", "local"], "readOnly": false, "type": "null or submodule" }, @@ -112,11 +90,7 @@ } ], "description": "path to the state file\n", - "loc": [ - "backend", - "local", - "path" - ], + "loc": ["backend", "local", "path"], "readOnly": false, "type": "string" }, @@ -130,10 +104,7 @@ ], "default": null, "description": "s3 backend\nhttps://www.terraform.io/docs/backends/types/s3.html\n", - "loc": [ - "backend", - "s3" - ], + "loc": ["backend", "s3"], "readOnly": false, "type": "null or submodule" }, @@ -146,11 +117,7 @@ } ], "description": "bucket name\n", - "loc": [ - "backend", - "s3", - "bucket" - ], + "loc": ["backend", "s3", "bucket"], "readOnly": false, "type": "string" }, @@ -163,11 +130,7 @@ } ], "description": "path to the state file in the bucket\n", - "loc": [ - "backend", - "s3", - "key" - ], + "loc": ["backend", "s3", "key"], "readOnly": false, "type": "string" }, @@ -180,11 +143,7 @@ } ], "description": "region of the bucket\n", - "loc": [ - "backend", - "s3", - "region" - ], + "loc": ["backend", "s3", "region"], "readOnly": false, "type": "string" }, @@ -199,9 +158,7 @@ "default": {}, "description": "Data objects, are queries to use resources which\nare already exist, as if they are created by a the resource\noption.\nSee for more details : https://www.terraform.io/docs/configuration/data-sources.html\n", "example": {}, - "loc": [ - "data" - ], + "loc": ["data"], "readOnly": false, "type": "" }, @@ -221,9 +178,7 @@ "service_name": "forum" } }, - "loc": [ - "locals" - ], + "loc": ["locals"], "readOnly": false, "type": "" }, @@ -244,9 +199,7 @@ } } }, - "loc": [ - "module" - ], + "loc": ["module"], "readOnly": false, "type": "" }, @@ -267,9 +220,7 @@ } } }, - "loc": [ - "output" - ], + "loc": ["output"], "readOnly": false, "type": "" }, @@ -291,9 +242,7 @@ } } }, - "loc": [ - "provider" - ], + "loc": ["provider"], "readOnly": false, "type": "" }, @@ -307,10 +256,7 @@ ], "description": "PrivateKey for provisioning via ssh access\nsee https://www.terraform.io/docs/provisioners/connection.html\n\nThis is an agnostic option, option-authors should use this options\nto implement server provisioning.\n", "example": "~/.ssh/id_rsa", - "loc": [ - "provisioner", - "privateKeyFile" - ], + "loc": ["provisioner", "privateKeyFile"], "readOnly": false, "type": "string" }, @@ -324,10 +270,7 @@ ], "default": {}, "description": "etcd remote state\nhttps://www.terraform.io/docs/backends/types/etcd.html\n", - "loc": [ - "remote_state", - "etcd" - ], + "loc": ["remote_state", "etcd"], "readOnly": false, "type": "attribute set of submodules" }, @@ -340,12 +283,7 @@ } ], "description": "A space-separated list of the etcd endpoints\n", - "loc": [ - "remote_state", - "etcd", - "", - "endpoints" - ], + "loc": ["remote_state", "etcd", "", "endpoints"], "readOnly": false, "type": "string" }, @@ -359,12 +297,7 @@ ], "default": null, "description": "the password\n", - "loc": [ - "remote_state", - "etcd", - "", - "password" - ], + "loc": ["remote_state", "etcd", "", "password"], "readOnly": false, "type": "null or string" }, @@ -377,12 +310,7 @@ } ], "description": "The path where to store the state\n", - "loc": [ - "remote_state", - "etcd", - "", - "path" - ], + "loc": ["remote_state", "etcd", "", "path"], "readOnly": false, "type": "string" }, @@ -396,12 +324,7 @@ ], "default": null, "description": "the username\n", - "loc": [ - "remote_state", - "etcd", - "", - "username" - ], + "loc": ["remote_state", "etcd", "", "username"], "readOnly": false, "type": "null or string" }, @@ -415,10 +338,7 @@ ], "default": {}, "description": "local remote state\nhttps://www.terraform.io/docs/backends/types/local.html\n", - "loc": [ - "remote_state", - "local" - ], + "loc": ["remote_state", "local"], "readOnly": false, "type": "attribute set of submodules" }, @@ -431,12 +351,7 @@ } ], "description": "path to the state file\n", - "loc": [ - "remote_state", - "local", - "", - "path" - ], + "loc": ["remote_state", "local", "", "path"], "readOnly": false, "type": "string" }, @@ -450,10 +365,7 @@ ], "default": {}, "description": "s3 remote state\nhttps://www.terraform.io/docs/backends/types/s3.html\n", - "loc": [ - "remote_state", - "s3" - ], + "loc": ["remote_state", "s3"], "readOnly": false, "type": "attribute set of submodules" }, @@ -466,12 +378,7 @@ } ], "description": "bucket name\n", - "loc": [ - "remote_state", - "s3", - "", - "bucket" - ], + "loc": ["remote_state", "s3", "", "bucket"], "readOnly": false, "type": "string" }, @@ -484,12 +391,7 @@ } ], "description": "path to the state file in the bucket\n", - "loc": [ - "remote_state", - "s3", - "", - "key" - ], + "loc": ["remote_state", "s3", "", "key"], "readOnly": false, "type": "string" }, @@ -502,12 +404,7 @@ } ], "description": "region of the bucket\n", - "loc": [ - "remote_state", - "s3", - "", - "region" - ], + "loc": ["remote_state", "s3", "", "region"], "readOnly": false, "type": "string" }, @@ -531,9 +428,7 @@ } } }, - "loc": [ - "resource" - ], + "loc": ["resource"], "readOnly": false, "type": "" }, @@ -558,9 +453,7 @@ } } }, - "loc": [ - "terraform" - ], + "loc": ["terraform"], "readOnly": false, "type": "" }, @@ -584,9 +477,7 @@ } } }, - "loc": [ - "users" - ], + "loc": ["users"], "readOnly": false, "type": "attribute set of attribute set of submoduless" }, @@ -601,12 +492,7 @@ "default": null, "description": "ssh public key of user\n", "example": "${ file( ~/.ssh/id_rsa.pub ) }", - "loc": [ - "users", - "", - "", - "publicKey" - ], + "loc": ["users", "", "", "publicKey"], "readOnly": false, "type": "null or string" }, @@ -628,9 +514,7 @@ } } }, - "loc": [ - "variable" - ], + "loc": ["variable"], "readOnly": false, "type": "" } diff --git a/content/options/hcloud-options/index.md b/content/options/hcloud-options/index.md index 6cc5c94..290cdc9 100644 --- a/content/options/hcloud-options/index.md +++ b/content/options/hcloud-options/index.md @@ -5,10 +5,10 @@ summary: | An opinionated hetzner cloud module. --- -An opinionated +An opinionated [hetzner cloud](https://www.terraform.io/docs/providers/hcloud/index.html) module. -Read more at +Read more at [https://github.com/terranix/terranix-hcloud](https://github.com/terranix/terranix-hcloud) ## use with terraform version 0.11 diff --git a/content/options/hcloud-options/options_export.json b/content/options/hcloud-options/options_export.json index cd35c60..7a27a34 100644 --- a/content/options/hcloud-options/options_export.json +++ b/content/options/hcloud-options/options_export.json @@ -10,10 +10,7 @@ "default": false, "description": "Whether to enable hcloud provider\nSee https://www.terraform.io/docs/providers/hcloud/index.html for documentation.\n.", "example": true, - "loc": [ - "hcloud", - "enable" - ], + "loc": ["hcloud", "enable"], "readOnly": false, "type": "boolean" }, @@ -27,11 +24,7 @@ ], "default": null, "description": "Export hcloud information as nix file.\nUseful when if you want to import\nrun a NixOS script after the terraform.\n", - "loc": [ - "hcloud", - "export", - "nix" - ], + "loc": ["hcloud", "export", "nix"], "readOnly": false, "type": "null or string" }, @@ -45,10 +38,7 @@ ], "default": {}, "description": "create a nixos server, via nixos-infect.\n", - "loc": [ - "hcloud", - "nixserver" - ], + "loc": ["hcloud", "nixserver"], "readOnly": false, "type": "attribute set of submodules" }, @@ -62,12 +52,7 @@ ], "default": false, "description": "enable backups or not\n", - "loc": [ - "hcloud", - "nixserver", - "", - "backups" - ], + "loc": ["hcloud", "nixserver", "", "backups"], "readOnly": false, "type": "boolean" }, @@ -81,12 +66,7 @@ ], "default": "nixos-19.09", "description": "nixos channel to install\n", - "loc": [ - "hcloud", - "nixserver", - "", - "channel" - ], + "loc": ["hcloud", "nixserver", "", "channel"], "readOnly": false, "type": "string" }, @@ -100,12 +80,7 @@ ], "default": null, "description": "The configuration.nix,\nonly used by the initial\nprovisioning by nixos-infect.\n", - "loc": [ - "hcloud", - "nixserver", - "", - "configurationFile" - ], + "loc": ["hcloud", "nixserver", "", "configurationFile"], "readOnly": false, "type": "null or path" }, @@ -120,12 +95,7 @@ "default": false, "description": "Whether to enable nixserver.", "example": true, - "loc": [ - "hcloud", - "nixserver", - "", - "enable" - ], + "loc": ["hcloud", "nixserver", "", "enable"], "readOnly": false, "type": "boolean" }, @@ -139,12 +109,7 @@ ], "default": "nixserver-‹name›", "description": "name of the server\n", - "loc": [ - "hcloud", - "nixserver", - "", - "name" - ], + "loc": ["hcloud", "nixserver", "", "name"], "readOnly": false, "type": "string" }, @@ -158,12 +123,7 @@ ], "default": [], "description": "provision steps. see `hcloud.server.provisioners`.\n", - "loc": [ - "hcloud", - "nixserver", - "", - "provisioners" - ], + "loc": ["hcloud", "nixserver", "", "provisioners"], "readOnly": false, "type": "list of attribute sets" }, @@ -177,12 +137,7 @@ ], "default": "cx11", "description": "Hardware equipment.This options influences costs!\n", - "loc": [ - "hcloud", - "nixserver", - "", - "serverType" - ], + "loc": ["hcloud", "nixserver", "", "serverType"], "readOnly": false, "type": "string" }, @@ -196,11 +151,7 @@ ], "default": null, "description": "Hetzner Cloud API endpoint,\ncan be used to override the default API Endpoint https://api.hetzner.cloud/v1\n", - "loc": [ - "hcloud", - "provider", - "endpoint" - ], + "loc": ["hcloud", "provider", "endpoint"], "readOnly": false, "type": "null or string" }, @@ -214,11 +165,7 @@ ], "default": "${ var.hcloud_api_token }", "description": "You need an API token to use the API.\nSign in into the Hetzner Cloud Console choose a project,\ngo to Access → Tokens, and create a new token. Make sure\nto copy the token because it won’t be shown to you again.\nA token is bound to a project, to interact with the API of another\nproject you have to create a new token inside the project\n\nIf you use a variable you can set it via the environment variable\nTF_VAR_hcloud_api_token.\n", - "loc": [ - "hcloud", - "provider", - "token" - ], + "loc": ["hcloud", "provider", "token"], "readOnly": false, "type": "string" }, @@ -232,10 +179,7 @@ ], "default": {}, "description": "servers deployed to the hcloud.\n", - "loc": [ - "hcloud", - "server" - ], + "loc": ["hcloud", "server"], "readOnly": false, "type": "attribute set of submodules" }, @@ -249,12 +193,7 @@ ], "default": false, "description": "enable backups or not\n", - "loc": [ - "hcloud", - "server", - "", - "backups" - ], + "loc": ["hcloud", "server", "", "backups"], "readOnly": false, "type": "boolean" }, @@ -269,12 +208,7 @@ "default": false, "description": "Whether to enable really deploy server\n.", "example": true, - "loc": [ - "hcloud", - "server", - "", - "enable" - ], + "loc": ["hcloud", "server", "", "enable"], "readOnly": false, "type": "boolean" }, @@ -288,12 +222,7 @@ ], "default": "ubuntu-18.04", "description": "image to spawn on the server\n", - "loc": [ - "hcloud", - "server", - "", - "image" - ], + "loc": ["hcloud", "server", "", "image"], "readOnly": false, "type": "string" }, @@ -307,12 +236,7 @@ ], "default": "‹name›", "description": "name of the server\n", - "loc": [ - "hcloud", - "server", - "", - "name" - ], + "loc": ["hcloud", "server", "", "name"], "readOnly": false, "type": "string" }, @@ -335,18 +259,11 @@ }, { "remote-exec": { - "inline": [ - "shutdown -r +1" - ] + "inline": ["shutdown -r +1"] } } ], - "loc": [ - "hcloud", - "server", - "", - "provisioners" - ], + "loc": ["hcloud", "server", "", "provisioners"], "readOnly": false, "type": "list of attribute sets" }, @@ -360,12 +277,7 @@ ], "default": "cx11", "description": "Hardware equipment. This options influences costs!\n", - "loc": [ - "hcloud", - "server", - "", - "serverType" - ], + "loc": ["hcloud", "server", "", "serverType"], "readOnly": false, "type": "string" } diff --git a/content/options/json_converter.sh b/content/options/json_converter.sh index 54a5c2b..471bd72 100644 --- a/content/options/json_converter.sh +++ b/content/options/json_converter.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cat "$1" | jq 'to_entries | .[] | { +jq 'to_entries | .[] | { label : .key, type : .value.type, description : .value.description, @@ -8,4 +8,4 @@ example: .value.example | tojson, default: .value.default | tojson, defined: .value.declarations[0].path, url: .value.declarations[0].url, -}' | jq -s +}' "$1" | jq -s diff --git a/static/manifest.json b/static/manifest.json index 7d2a0a4..149bccf 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -8,4 +8,4 @@ } ], "display": "standalone" -} \ No newline at end of file +} From fed4efd0c94f336bea2fb4e24fd4e1fa1bf47936 Mon Sep 17 00:00:00 2001 From: Sagi Sarussi Date: Sat, 21 Oct 2023 16:46:04 +0300 Subject: [PATCH 10/10] Checking that it works 2 --- config.yaml | 1 - content/news/release-2.7.0.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index a746b65..daccd4c 100644 --- a/config.yaml +++ b/config.yaml @@ -47,4 +47,3 @@ menu: identifier: "options" weight: 4 title: opinionated terranix modules - diff --git a/content/news/release-2.7.0.md b/content/news/release-2.7.0.md index b587353..aaa492a 100644 --- a/content/news/release-2.7.0.md +++ b/content/news/release-2.7.0.md @@ -15,4 +15,4 @@ for your input on this release. - add templatefile() helper - add lib.tf -- add referenceable functor \ No newline at end of file +- add referenceable functor