forked from o11ydev/oy-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool-documentation.nix
67 lines (55 loc) · 1.62 KB
/
tool-documentation.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
pkgs,
tool,
name,
description,
}: let
usage = pkgs.runCommand "${name} --help" {} "${tool}/bin/${name} --help &> $out";
documentation = pkgs.writeTextFile {
name = "${name}-doc.md";
text = ''
---
title: ${name}
geekdocRepo: "https://github.com/o11ydev/oy-toolkit"
geekdocEditPath: "edit/main/cmd/${name}"
geekdocFilePath: "README.md"
---
${builtins.readFile ./docs/tools-top.md}
## Usage
```
${builtins.readFile usage}
```
## Description
${builtins.readFile description}
## Downloading
{{< tabs "usage" >}}
{{< tab "linux (wget)" >}}
To execute **${name}** within Linux, run:
```
wget https://github.com/o11ydev/oy-toolkit/releases/download/main/${name} -O ${name} && chmod +x ${name} && ./${name} --help
```
{{< /tab >}}
{{< tab "linux (deb)" >}}
**${name}** is available as a `.deb` package:
https://github.com/o11ydev/oy-toolkit/releases/download/main/${name}.deb
{{< /tab >}}
{{< tab "linux (yum)" >}}
**${name}** is available as a `.rpm` package:
https://github.com/o11ydev/oy-toolkit/releases/download/main/${name}.rpm
{{< /tab >}}
{{< tab "docker" >}}
To execute **${name}** with docker, run:
```
docker run quay.io/o11y/oy-toolkit:${name} --help
```
{{< /tab >}}
{{< tab "nix" >}}
To execute **${name}** with nix, run:
```
nix run github:o11ydev/oy-toolkit#${name} -- --help
```
{{< /tab >}}
{{< /tabs >}}
'';
};
in "cat ${documentation} >> $out/${name}.md"