Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/infrastructure: embed host config json #1673

Merged
merged 3 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 59 additions & 34 deletions dev/docs.nix
Original file line number Diff line number Diff line change
@@ -1,39 +1,64 @@
{ config, pkgs, ... }:
{ self, ... }:
{
devShells.mkdocs = pkgs.mkShellNoCC { inputsFrom = [ config.packages.docs ]; };
packages = {
docs =
pkgs.runCommand "docs"
{
buildInputs = [
pkgs.python3.pkgs.mkdocs-material
pkgs.python3.pkgs.mkdocs-material.optional-dependencies.recommended
];
files = pkgs.lib.fileset.toSource {
root = ../.;
fileset = pkgs.lib.fileset.unions [
../docs
../mkdocs.yml
];
perSystem =
{ config, pkgs, ... }:
{
devShells.mkdocs = pkgs.mkShellNoCC { inputsFrom = [ config.packages.docs ]; };
packages = {
docs =
pkgs.runCommand "docs"
{
buildInputs = [
pkgs.python3.pkgs.mkdocs-material
pkgs.python3.pkgs.mkdocs-material.optional-dependencies.recommended
];
files = pkgs.lib.fileset.toSource {
root = ../.;
fileset = pkgs.lib.fileset.unions [
../docs
../mkdocs.yml
];
};
}
''
cp --no-preserve=mode -r $files/* .
cp --no-preserve=mode ${config.packages.docs-json}/*.json docs
mkdocs build --strict --site-dir $out
'';
docs-linkcheck = pkgs.testers.lycheeLinkCheck rec {
extraConfig = {
include_mail = true;
include_verbatim = true;
};
}
''
cd $files
mkdocs build --strict --site-dir $out
'';
docs-linkcheck = pkgs.testers.lycheeLinkCheck rec {
extraConfig = {
exclude = [
"https://fonts.gstatic.com"
"https://monitoring.nix-community.org/alertmanager" # 401 behind auth
];
include_mail = true;
include_verbatim = true;
};
remap = {
"https://nix-community.org" = site;
remap = {
"https://nix-community.org" = site;
};
site = config.packages.docs;
};
docs-json =
pkgs.runCommand "docs-json"
{
buildInputs = [ pkgs.jq ];
hosts = pkgs.writeText "hosts.json" (
builtins.toJSON (
pkgs.lib.mapAttrs (_: x: {
experimental-features = x.config.nix.settings.experimental-features or [ ];
extra-platforms = x.config.nix.settings.extra-platforms or [ ];
system-features = x.config.nix.settings.system-features or [ ];
inherit (x.config.nixpkgs.hostPlatform) system;
inherit (x.config.nix.settings) sandbox;
}) (self.darwinConfigurations // self.nixosConfigurations)
)
);
}
''
mkdir -p $out
for host in $(jq -r 'keys[]' $hosts); do
jq --arg host "$host" \
'.[$host] | walk(if type == "array" then sort else . end)' \
--sort-keys < $hosts > $out/$host.json
done
'';
};
site = config.packages.docs;
};
};
}
2 changes: 2 additions & 0 deletions docs/community-builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ aarch64-build-box.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9uyfhy
darwin-build-box.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKMHhlcn7fUpUuiOFeIhDqBzBNFsbNqq+NpzuGX3e6zv
```

See [here](./infrastructure.md#community-builders) for details about the hardware.

### Access

We will grant access to well known members of the community, and people well known members in the community trust.
Expand Down
2 changes: 2 additions & 0 deletions docs/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Both `aarch64-linux` and `x86_64-linux` have support for `kvm`/`nixos-test`.

We only have limited build capacity for `*-darwin` so please don't use it excessively.

See [here](./infrastructure.md#continuous-integration) for details about the hardware.

#### Buildbot

[https://buildbot.nix-community.org](https://buildbot.nix-community.org)
Expand Down
28 changes: 28 additions & 0 deletions docs/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- RAM: 128GB DDR4 ECC
- Drives: 2 x 1.92TB NVME

```json
--8<-- "docs/build01.json"
```

#### [`aarch64-build-box.nix-community.org`](./community-builders.md) - `build05`

- Provider: Hetzner
Expand All @@ -15,6 +19,10 @@
- RAM: 128GB DDR4 ECC
- Drives: 2 x 960GB NVME

```json
--8<-- "docs/build05.json"
```

#### [`darwin-build-box.nix-community.org`](./community-builders.md) - `darwin01`

- Provider: OakHost
Expand All @@ -23,6 +31,10 @@
- RAM: 32GB
- Drives: 1TB SSD

```json
--8<-- "docs/darwin01.json"
```

### Continuous Integration

#### [`CI builder`](./continuous-integration.md) - `build03`
Expand All @@ -33,6 +45,10 @@
- RAM: 256GB DDR5 ECC
- Drives: 2 x 1.92TB NVME

```json
--8<-- "docs/build03.json"
```

#### [`CI builder`](./continuous-integration.md) - `build04`

- Provider: Hetzner
Expand All @@ -41,6 +57,10 @@
- RAM: 128GB DDR4 ECC
- Drives: 2 x 960GB NVME

```json
--8<-- "docs/build04.json"
```

#### [`CI builder`](./continuous-integration.md) - `darwin02`

- Provider: OakHost
Expand All @@ -49,6 +69,10 @@
- RAM: 32GB
- Drives: 1TB SSD

```json
--8<-- "docs/darwin02.json"
```

### Other

#### [`R. RyanTM nixpkgs-update bot`](./update-bot.md) - `build02`
Expand All @@ -58,6 +82,10 @@
- RAM: 128GB DDR4 ECC
- Drives: 2 x 1.92TB NVME

```json
--8<-- "docs/build02.json"
```

#### [`Monitoring`](./monitoring.md) - `web02`

- Provider: Gandi
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
systems = import inputs.systems;

imports = [
./dev/docs.nix
./dev/effect-deploy.nix
./modules
inputs.hercules-ci-effects.flakeModule
Expand Down Expand Up @@ -107,7 +108,6 @@
}:
{
imports = [
./dev/docs.nix
./dev/shell.nix
./terraform/shell.nix
];
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ theme:
markdown_extensions:
- attr_list
- md_in_html
- pymdownx.snippets
- pymdownx.superfences
- toc:
toc_depth: 0

Expand Down