Skip to content

Commit 95804de

Browse files
authored
feat(docs): Add links to module docs (#479)
Closes #476 Here's a first pass at linking to the modules. I thought about finding a way to automate this (eg. populating the links directly from the exposed flake modules) but couldn't find a clean solution.
1 parent 9a04d74 commit 95804de

11 files changed

+45
-41
lines changed

docs/darwin/getting_started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
This project exports four big categories of NixOS modules which are useful to define a server configuration:
66

7-
* Machine type - these are high-level settings that define the machine type (Eg: common, server or desktop). Only one of those would be included.
8-
* Configuration mixins - these define addons to be added to the machine configuration. One or more can be added.
7+
* [Machine type](./type.md) - these are high-level settings that define the machine type (Eg: common, server or desktop). Only one of those would be included.
8+
* [Configuration mixins](./mixins.md) - these define addons to be added to the machine configuration. One or more can be added.
99

1010
## Example
1111

docs/darwin/mixins.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ Config extensions for a given machine.
22

33
One or more can be included per Darwin configuration.
44

5-
### `darwiModules.mixins-telegraf`
5+
### [`darwinModules.mixins-telegraf`]({{ repo_url }}/blob/main/darwin/mixins/telegraf.nix)
66

77
Enables a generic telegraf configuration. `nixosModules.mixins-prometheus` for monitoring rules targeting this telegraf configuration.
88

9-
### `darwinModules.mixins-terminfo`
9+
### [`darwinModules.mixins-terminfo`]({{ repo_url }}/blob/main/darwin/mixins/terminfo.nix)
1010

1111
Extends the terminfo database with often used terminal emulators.
1212
Terminfo is used by terminal applications to interfere supported features in the terminal.
1313
This is useful when connecting to a server via SSH.
1414

15-
### `darwinModules.mixins-nix-experimental`
15+
### [`darwinModules.mixins-nix-experimental`]({{ repo_url }}/blob/main/darwin/mixins/nix-experimental.nix)
1616

1717
Enables all experimental features in nix, that are known safe to use (i.e. are only used when explicitly requested in a build).
1818

19-
### `darwinModules.mixins-trusted-nix-caches`
19+
### [`darwinModules.mixins-trusted-nix-caches`]({{ repo_url }}/blob/main/darwin/mixins/trusted-nix-caches.nix)
2020

2121
Add the common list of public nix binary caches that we trust.

docs/darwin/type.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Those high-level modules are used to define the type of machine.
22

33
We expect only one of those to be imported per Darwin configuration.
44

5-
### Common (`darwinModules.common`)
5+
### Common ([`darwinModules.common`]({{ repo_url }}/blob/main/darwin/common/default.nix))
66

77
Use this module if you are unsure if your darwin module will be used on server or desktop.
88

@@ -17,14 +17,14 @@ Use this module if you are unsure if your darwin module will be used on server o
1717
- Enable sudo for @wheel users.
1818
- ...
1919

20-
### Server (`darwinModules.server`)
20+
### Server ([`darwinModules.server`]({{ repo_url }}/blob/main/darwin/server/default.nix))
2121

2222
Use this for headless systems that are remotely managed via ssh.
2323

2424
- Includes everything from common
2525
- So far nothing else, but this might change over time
2626

27-
### Desktop (`darwinModules.desktop`)
27+
### Desktop ([`darwinModules.desktop`]({{ repo_url }}/blob/main/darwin/desktop/default.nix))
2828

2929
Despite this project being about servers, we wanted to dogfood the common module.
3030

docs/getting_started.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ This project is designed to work in combination with the Linux distribution [Nix
44

55
In this documentation, we expect the reader to be already familiar with the base operating system, and introduce how to compose it with our own extensions.
66

7-
For NixOS continue reading [here](nixos/getting_started.md),
8-
for nix-darwin/macOS read [this](darwin/getting_started.md).
9-
7+
For NixOS continue reading [here](./nixos/getting_started.md),
8+
for nix-darwin/macOS read [this](./darwin/getting_started.md).

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Welcome!
44

55
SrvOS is a collection of NixOS modules that are optimized for servers. They includes many lessons that we gained over the years while deploying servers for our customers. As we like to share, we hope that this project will be useful to you.
66

7-
To get started, start by reading the [introductory tutorial](getting_started.md), then check the [User Guide](user_guide.md) for more information.
7+
To get started, start by reading the [introductory tutorial](./getting_started.md), then check the [User Guide](user_guide.md) for more information.

docs/nixos/getting_started.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
This project exports four big categories of NixOS modules which are useful to define a server configuration:
66

7-
* Machine type - these are high-level settings that define the machine type (Eg: common, server or desktop). Only one of those would be included.
8-
* Machine hardware - these define hardware-related settings for well known hardware. Only one of those would be included. (eg: AWS EC2 instances).
9-
* Machine role - theses take over a machine for a specific role. Only one of those would be included. (eg: GitHub Actions runner)
10-
* Configuration mixins - these define addons to be added to the machine configuration. One or more can be added.
7+
* [Machine type](./type.md) - these are high-level settings that define the machine type (Eg: common, server or desktop). Only one of those would be included.
8+
* [Machine hardware](./hardware.md) - these define hardware-related settings for well known hardware. Only one of those would be included. (eg: AWS EC2 instances).
9+
* [Machine role](./role.md) - theses take over a machine for a specific role. Only one of those would be included. (eg: GitHub Actions runner)
10+
* [Configuration mixins](./mixins.md) - these define addons to be added to the machine configuration. One or more can be added.
1111

1212
## Example
1313

docs/nixos/hardware.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@ We expect only one hardware module to be imported per NixOS configuration.
44

55
Here are some of the hardwares that are supported:
66

7-
### `nixosModules.hardware-amazon`
7+
### [`nixosModules.hardware-amazon`]({{ repo_url }}/blob/main/nixos/hardware/amazon/default.nix)
88

99
Hardware configuration for <https://aws.amazon.com/ec2> instances.
1010

1111
The main difference here is that the default userdata service is replaced by cloud-init.
1212

13-
### `nixosModules.hardware-digitalocean-droplet`
13+
### [`nixosModules.hardware-digitalocean-droplet`]({{ repo_url }}/blob/main/nixos/hardware/digitalocean/droplet.nix)
1414

1515
Hardware configuration for <https://www.digitalocean.com/> instances.
1616

1717
Enables cloud-init but turns of non-working dhcp.
1818

19-
### `nixosModules.hardware-hetzner-cloud`
19+
### [`nixosModules.hardware-hetzner-cloud`]({{ repo_url }}/blob/main/nixos/hardware/hetzner-cloud/default.nix)
2020

2121
Hardware configuration for <https://www.hetzner.com/cloud> instances.
2222

2323
The main difference here is that:
2424
1. cloud-init is enabled.
2525
2. the qemu agent is running, to allow password reset to function.
2626

27-
### `nixosModules.hardware-hetzner-cloud-arm`
27+
### [`nixosModules.hardware-hetzner-cloud-arm`]({{ repo_url }}/blob/main/nixos/hardware/hetzner-cloud/arm.nix)
2828

2929
Hardware configuration for <https://www.hetzner.com/cloud> arm instances.
3030

3131
The main difference from `nixosModules.hardware-hetzner-cloud` is using systemd-boot by default.
3232

33-
### `nixosModules.hardware-hetzner-online-amd`
33+
### [`nixosModules.hardware-hetzner-online-amd`]({{ repo_url }}/blob/main/nixos/hardware/hetzner-online/amd.nix)
3434

3535
Hardware configuration for <https://www.hetzner.com/dedicated-rootserver> bare-metal AMD servers.
3636

3737
Introduces some workaround for the particular IPv6 configuration that Hetzner has.
3838

39-
### `nixosModules.hardware-hetzner-online-intel`
39+
### [`nixosModules.hardware-hetzner-online-intel`]({{ repo_url }}/blob/main/nixos/hardware/hetzner-online/intel.nix)
4040

4141
Hardware configuration for <https://www.hetzner.com/dedicated-rootserver> bare-metal Intel servers.
4242

4343
Introduces some workaround for the particular IPv6 configuration that Hetzner has.
4444

45-
### `nixosModules.hardware-hetzner-online-ex101`
45+
### [`nixosModules.hardware-hetzner-online-ex101`]({{ repo_url }}/blob/main/nixos/hardware/hetzner-online/ex101.nix)
4646

4747
Hardware configuration for <https://www.hetzner.com/de/dedicated-rootserver/ex101> bare-metal Intel Core i9-13900 servers.
4848

docs/nixos/mixins.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@ Config extensions for a given machine.
22

33
One or more can be included per NixOS configuration.
44

5-
### `nixosModules.mixins-cloud-init`
5+
### [`nixosModules.mixins-cloud-init`]({{ repo_url }}/blob/main/nixos/mixins/cloud-init.nix)
66

77
Enables [cloud-init](https://cloud-init.io)
88

9-
### `nixosModules.mixins-systemd-boot`
9+
### [`nixosModules.mixins-systemd-boot`]({{ repo_url }}/blob/main/nixos/mixins/systemd-boot.nix)
1010

1111
Configure systemd-boot as bootloader.
1212

13-
### `nixosModules.mixins-telegraf`
13+
### [`nixosModules.mixins-telegraf`]({{ repo_url }}/blob/main/nixos/mixins/telegraf.nix)
1414

1515
Enables a generic telegraf configuration. `nixosModules.mixins-prometheus` for monitoring rules targeting this telegraf configuration.
1616

17-
### `nixosModules.mixins-terminfo`
17+
### [`nixosModules.mixins-terminfo`]({{ repo_url }}/blob/main/nixos/mixins/terminfo.nix)
1818

1919
Extends the terminfo database with often used terminal emulators.
2020
Terminfo is used by terminal applications to interfere supported features in the terminal.
2121
This is useful when connecting to a server via SSH.
2222

23-
### `nixosModules.mixins-prometheus`
23+
### [`nixosModules.mixins-prometheus`]({{ repo_url }}/blob/main/nixos/mixins/prometheus.nix)
2424

2525
Enables a Prometheus and configures it with a set of alert rules targeting our `nixosModules.mixins-prometheus` module.
2626

27-
### `nixosModules.mixins-nginx`
27+
### [`nixosModules.mixins-nginx`]({{ repo_url }}/blob/main/nixos/mixins/nginx.nix)
2828

2929
Configure Nginx with recommended settings. Is quite useful when using nginx as a reverse-proxy on the machine to other services.
3030

31-
### `nixosModules.mixins-nix-experimental`
31+
### [`nixosModules.mixins-nix-experimental`]({{ repo_url }}/blob/main/nixos/mixins/nix-experimental.nix)
3232

3333
Enables all experimental features in nix, that are known safe to use (i.e. are only used when explicitly requested in a build).
3434
This for example unlocks use of containers in the nix sandbox.
3535

36-
### `nixosModules.mixins-trusted-nix-caches`
36+
### [`nixosModules.mixins-trusted-nix-caches`]({{ repo_url }}/blob/main/nixos/mixins/trusted-nix-caches.nix)
3737

3838
Add the common list of public nix binary caches that we trust.
3939

40-
### `nixosModules.mixins-mdns`
40+
### [`nixosModules.mixins-mdns`]({{ repo_url }}/blob/main/nixos/mixins/mdns.nix)
4141

42-
Enables mDNS support in systemd-networkd. Becomes a no-op if avahi is enabled on the same machine
42+
Enables mDNS support in systemd-networkd. Becomes a no-op if avahi is enabled on the same machine.

docs/nixos/role.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ We assume that only one role is assigned per machine.
44

55
By making this assumption, we are able to make deeper change to the machine configuration, without having to worry about potential conflicts with other roles.
66

7-
### GitHub Actions runner (`nixosConfiguration.roles-github-actions-runner`)
7+
### GitHub Actions runner ([`nixosConfiguration.roles-github-actions-runner`]({{ repo_url }}/blob/main/nixos/roles/github-actions-runner.nix))
88

99
Dedicates the machine to becoming a cluster of GitHub Actions runners.
1010

11-
### Nix Remote builder (`nixosConfiguration.roles-nix-remote-builder`)
11+
### Nix Remote builder ([`nixosConfiguration.roles-nix-remote-builder`]({{ repo_url }}/blob/main/nixos/roles/nix-remote-builder.nix))
1212

13-
Dedicates the machine to acting as a remote builder for Nix. The main use-case we have is to add more build capacity to the GitHub Actions runners, in a star fashion.
13+
Dedicates the machine to acting as a remote builder for Nix. The main use-case we have is to add more build capacity to the GitHub Actions runners, in a star fashion.

docs/nixos/type.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Those high-level modules are used to define the type of machine.
22

33
We expect only one of those to be imported per NixOS configuration.
44

5-
### Common (`nixosModules.common`)
5+
### Common ([`nixosModules.common`]({{ repo_url }}/blob/main/nixos/common/default.nix))
66

77
Use this module if you are unsure if your nixos module will be used on server or desktop.
88

@@ -17,7 +17,7 @@ Use this module if you are unsure if your nixos module will be used on server or
1717
- Enable sudo for @wheel users.
1818
- ...
1919

20-
### Server (`nixosModules.server`)
20+
### Server ([`nixosModules.server`]({{ repo_url }}/blob/main/nixos/server/default.nix))
2121

2222
Use this for headless systems that are remotely managed via ssh.
2323

@@ -29,7 +29,7 @@ Use this for headless systems that are remotely managed via ssh.
2929
- Sets up sudo without password
3030
- ...
3131

32-
### Desktop (`nixosModules.desktop`)
32+
### Desktop ([`nixosModules.desktop`]({{ repo_url }}/blob/main/nixos/desktop/default.nix))
3333

3434
Despite this project being about servers, we wanted to dogfood the common module.
3535

mkdocs.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ site_name: SrvOS
66
site_description: NixOS profiles for servers
77
site_url: https://nix-community.github.io/srvos/
88
repo_name: 'nix-community/srvos'
9-
repo_url: https://github.com/nix-community/srvos
9+
repo_url: &repo_url https://github.com/nix-community/srvos
1010
edit_uri: edit/main/docs
1111

1212
### Navigation ###
@@ -36,3 +36,8 @@ nav:
3636
- Configuration mixins: darwin/mixins.md
3737
- FAQ: faq.md
3838
- Getting help: help.md
39+
40+
### Extra variables
41+
42+
extra:
43+
repo_url: *repo_url

0 commit comments

Comments
 (0)