From 1e08a454fbe5a0ace35e52359204f04b38344233 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 15:22:20 +0200 Subject: [PATCH 01/12] docs: self host documentation with mkDocs --- docs/.envrc | 6 ++ docs/.gitignore | 2 + docs/admins/_index.md | 10 --- docs/default.nix | 26 +++++++ docs/{contributing => docs}/contributing.md | 0 .../drafts/install-iso.md} | 2 +- .../getting-started/backups.md} | 2 +- .../getting-started/flake-parts.md} | 4 +- .../getting-started/index.md} | 12 ++-- .../getting-started/installer.md} | 4 +- .../getting-started/machines.md} | 10 +-- .../getting-started/networking.md} | 2 +- .../getting-started/secrets.md} | 2 +- .../templates/index.md} | 8 ++- docs/flake-module.nix | 13 ++++ docs/mkdocs.yml | 68 +++++++++++++++++++ docs/shell.nix | 1 + flake.nix | 1 + 18 files changed, 142 insertions(+), 31 deletions(-) create mode 100644 docs/.envrc create mode 100644 docs/.gitignore delete mode 100644 docs/admins/_index.md create mode 100644 docs/default.nix rename docs/{contributing => docs}/contributing.md (100%) rename docs/{admins/05-install-iso.md => docs/drafts/install-iso.md} (99%) rename docs/{admins/07-backups.md => docs/getting-started/backups.md} (99%) rename docs/{admins/08-flake-parts.md => docs/getting-started/flake-parts.md} (97%) rename docs/{admins/01-quickstart.md => docs/getting-started/index.md} (88%) rename docs/{admins/03-Installer.md => docs/getting-started/installer.md} (97%) rename docs/{admins/02-machines.md => docs/getting-started/machines.md} (93%) rename docs/{admins/04-networking.md => docs/getting-started/networking.md} (98%) rename docs/{admins/06-secrets.md => docs/getting-started/secrets.md} (99%) rename docs/{admins/99-templates.md => docs/templates/index.md} (62%) create mode 100644 docs/flake-module.nix create mode 100644 docs/mkdocs.yml create mode 100644 docs/shell.nix diff --git a/docs/.envrc b/docs/.envrc new file mode 100644 index 000000000..18267144c --- /dev/null +++ b/docs/.envrc @@ -0,0 +1,6 @@ +source_up + +watch_file flake-module.nix shell.nix default.nix + +# Because we depend on nixpkgs sources, uploading to builders takes a long time +use flake .#docs --builders '' diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..d823e3fbf --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +# build oputputs +site \ No newline at end of file diff --git a/docs/admins/_index.md b/docs/admins/_index.md deleted file mode 100644 index b2f084adc..000000000 --- a/docs/admins/_index.md +++ /dev/null @@ -1,10 +0,0 @@ -+++ -title = "Admin Documentation" -description = "Documentation for administrators. Create and manage one or multiple cLANs" -date = 2025-05-01T19:00:00+00:00 -updated = 2021-05-01T19:00:00+00:00 -template = "docs/section.html" -weight = 15 -sort_by = "title" -draft = false -+++ diff --git a/docs/default.nix b/docs/default.nix new file mode 100644 index 000000000..28fb890e3 --- /dev/null +++ b/docs/default.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +pkgs.stdenv.mkDerivation { + name = "clan-documentation"; + + src = ./.; + + nativeBuildInputs = + [ pkgs.python3 ] + ++ (with pkgs.python3Packages; [ + mkdocs + mkdocs-material + mkdocs-drawio-exporter + mkdocs-swagger-ui-tag + plantuml-markdown + ]); + + buildPhase = '' + mkdocs build --strict + + ls -la . + ''; + + installPhase = '' + cp -a site/ $out/ + ''; +} diff --git a/docs/contributing/contributing.md b/docs/docs/contributing.md similarity index 100% rename from docs/contributing/contributing.md rename to docs/docs/contributing.md diff --git a/docs/admins/05-install-iso.md b/docs/docs/drafts/install-iso.md similarity index 99% rename from docs/admins/05-install-iso.md rename to docs/docs/drafts/install-iso.md index 9304a4de2..5835b9768 100644 --- a/docs/admins/05-install-iso.md +++ b/docs/docs/drafts/install-iso.md @@ -1,4 +1,4 @@ -# 03 Clan Hardware Installation +# Hardware Installation For installations on physical hardware, create a NixOS installer image and transfer it to a bootable USB drive as described below. diff --git a/docs/admins/07-backups.md b/docs/docs/getting-started/backups.md similarity index 99% rename from docs/admins/07-backups.md rename to docs/docs/getting-started/backups.md index cebd25e33..025712057 100644 --- a/docs/admins/07-backups.md +++ b/docs/docs/getting-started/backups.md @@ -1,4 +1,4 @@ -# 07 Backups +# Backups ## Introduction to Backups diff --git a/docs/admins/08-flake-parts.md b/docs/docs/getting-started/flake-parts.md similarity index 97% rename from docs/admins/08-flake-parts.md rename to docs/docs/getting-started/flake-parts.md index 3fcec3cd0..5743a335a 100644 --- a/docs/admins/08-flake-parts.md +++ b/docs/docs/getting-started/flake-parts.md @@ -1,4 +1,4 @@ -# 08 Clan with `flake-parts` +# Clan with `flake-parts` Clan supports integration with [flake.parts](https://flake.parts/) a tool which allows modular compositions. @@ -82,7 +82,7 @@ refer to the Clan module documentation located [here](https://git.clan.lol/clan/ ### Next Steps -With your flake created, explore how to add new machines by reviewing the documentation provided [here](./02-machines.md). +With your flake created, explore how to add new machines by reviewing the documentation provided [here](machines.md). --- diff --git a/docs/admins/01-quickstart.md b/docs/docs/getting-started/index.md similarity index 88% rename from docs/admins/01-quickstart.md rename to docs/docs/getting-started/index.md index 8ed1b9182..afd8816b4 100644 --- a/docs/admins/01-quickstart.md +++ b/docs/docs/getting-started/index.md @@ -1,4 +1,4 @@ -# 01 Getting Started +# Getting Started Welcome to your simple guide on starting a new Clan project! @@ -7,7 +7,7 @@ Welcome to your simple guide on starting a new Clan project! We've put together a straightforward guide to help you out: - [**Starting with a New Clan Project**](#starting-with-a-new-clan-project): Create a new Clan from scratch. -- [**Integrating Clan using Flake-Parts**](./08-flake-parts.md) +- [**Integrating Clan using Flake-Parts**](flake-parts.md) --- @@ -80,7 +80,7 @@ Open the `flake.nix` file and set a unique `clanName` if you want you can also s **Right now clan assumes that you already have NixOS running on the target machine.** -If that is not the case you can use our [installer image](./05-install-iso.md) that automatically generates an endpoint reachable over TOR with a random ssh password. +If that is not the case you can use our [installer image](installer.md) that automatically generates an endpoint reachable over TOR with a random ssh password. On the remote execute: 1. Generate a hardware-config.nix @@ -107,11 +107,11 @@ On the remote execute: ``` ### **Next Steps** -Ready to expand? Explore how to install a new machine with the helpful documentation [here](./02-machines.md). +Ready to expand? Explore how to install a new machine with the helpful documentation [here](machines.md). Ready to explore more? -- **Adding New Machines to your setup**. [Following our templates](./99-templates.md) +- **Adding New Machines to your setup**. [Following our templates](../templates/index.md) -- **Use a USB drive to Set Up Machines**: Setting up new computers remotely is easy with a USB stick. [Learn how](./02-machines.md). +- **Use a USB drive to Set Up Machines**: Setting up new computers remotely is easy with a USB stick. [Learn how](machines.md). --- diff --git a/docs/admins/03-Installer.md b/docs/docs/getting-started/installer.md similarity index 97% rename from docs/admins/03-Installer.md rename to docs/docs/getting-started/installer.md index 2da7159aa..d2d94844b 100644 --- a/docs/admins/03-Installer.md +++ b/docs/docs/getting-started/installer.md @@ -1,4 +1,4 @@ -# 03 Clan Installer +# Installer We offer a dedicated installer to assist remote installations. @@ -84,7 +84,7 @@ See: Guide for Wifi Below ### Whats next? -- [Deploying Machines](./02-machines.md): Deploying a Machine configuration +- [Deploying Machines](machines.md): Deploying a Machine configuration - [WiFi](#optional-connect-to-wifi): Guide for connecting to Wifi. --- diff --git a/docs/admins/02-machines.md b/docs/docs/getting-started/machines.md similarity index 93% rename from docs/admins/02-machines.md rename to docs/docs/getting-started/machines.md index 9d588cbc8..6a4e8cbd9 100644 --- a/docs/admins/02-machines.md +++ b/docs/docs/getting-started/machines.md @@ -1,4 +1,4 @@ -# 02 Machines with Clan +# Deploy Machine Integrating a new machine into your Clan environment is a very easy yet flexible process, allowing for a straight forward management of multiple NixOS configurations. @@ -12,7 +12,7 @@ This process involves preparing a suitable hardware and disk partitioning config ### Step 0. Prerequisites -Boot the target machine using our [Clan Installer](./03-Installer.md). Which is recommended for ensuring most efficient workflows. +Boot the target machine using our [Clan Installer](installer.md). Which is recommended for ensuring most efficient workflows. Alternatively you can use any linux machine if it is reachable via SSH and supports `kexec`. @@ -23,9 +23,9 @@ ssh root@ ``` - [x] **Two Computers**: You need one computer that you're getting ready (we'll call this the Target Computer) and another one to set it up from (we'll call this the Setup Computer). Make sure both can talk to each other over the network using SSH. -- [x] **Machine configuration**: You want to deploy. [Check out our templates](./99-templates.md) -- [x] Initialized secrets: See [secrets](./06-secrets.md) for how to initialize your secrets. -- [x] (Optional) USB Flash Drive with the [Clan Installer](./03-Installer.md) +- [x] **Machine configuration**: You want to deploy. [Check out our templates](../templates/index.md) +- [x] Initialized secrets: See [secrets](secrets.md) for how to initialize your secrets. +- [x] (Optional) USB Flash Drive with the [Clan Installer](installer.md) ### Step 1. Identify Target Disk-ID diff --git a/docs/admins/04-networking.md b/docs/docs/getting-started/networking.md similarity index 98% rename from docs/admins/04-networking.md rename to docs/docs/getting-started/networking.md index 308a3b4d7..e1a4dfcc2 100644 --- a/docs/admins/04-networking.md +++ b/docs/docs/getting-started/networking.md @@ -1,4 +1,4 @@ -# 04 Overlay Networks in Clan +# Overlay Networks This guide provides detailed instructions for configuring [ZeroTier VPN](https://zerotier.com) within Clan. Follow the diff --git a/docs/admins/06-secrets.md b/docs/docs/getting-started/secrets.md similarity index 99% rename from docs/admins/06-secrets.md rename to docs/docs/getting-started/secrets.md index 447aafcc9..35378dba6 100644 --- a/docs/admins/06-secrets.md +++ b/docs/docs/getting-started/secrets.md @@ -1,4 +1,4 @@ -# 06 Secrets with Clan +# Secrets Clan enables encryption of secrets (such as passwords & keys) ensuring security and ease-of-use among users. diff --git a/docs/admins/99-templates.md b/docs/docs/templates/index.md similarity index 62% rename from docs/admins/99-templates.md rename to docs/docs/templates/index.md index 6d76de74e..12c6bce26 100644 --- a/docs/admins/99-templates.md +++ b/docs/docs/templates/index.md @@ -1,13 +1,17 @@ -# 99 Templates +# Templates We provide some starting templates you can easily use one of those via `nix flakes`. They showcase best practices and guide you through setting up and using Clan's modules -To use the `new-clan` template run the following command: +I.e. To use the `new-clan` template run the following command: `nix flake init -t git+https://git.clan.lol/clan/clan-core#new-clan`. ## Available Templates +We offer the following templates: + +To initialize a clan with one of those run `nix flake init -t git+https://git.clan.lol/clan/clan-core#TEMPLATE_NAME` + - **new-clan**: Perfect for beginners, this template shows you how to link two machines in a basic setup. diff --git a/docs/flake-module.nix b/docs/flake-module.nix new file mode 100644 index 000000000..0d07108d1 --- /dev/null +++ b/docs/flake-module.nix @@ -0,0 +1,13 @@ +{ inputs, ... }: +{ + perSystem = + { self', pkgs, ... }: + { + devShells.docs = pkgs.callPackage ./shell.nix { inherit (self'.packages) docs; }; + packages = { + docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; }; + }; + + checks = self'.packages.clan-cli.tests; + }; +} diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 000000000..de2f63147 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,68 @@ +site_name: Design +site_url: https://docs.clan.lol +repo_url: https://git.clan.lol/clan/clan-core/ +repo_name: clan-core +edit_uri: _edit/main/docs/docs/ + +validation: + omitted_files: warn + absolute_links: warn + unrecognized_links: warn + +markdown_extensions: + - footnotes + - meta + - admonition + - pymdownx.details + - pymdownx.highlight: + use_pygments: true + - pymdownx.superfences + - plantuml_markdown + - toc: + title: On this page + +exclude_docs: | + .* + !templates/ + /drafts/ + +nav: + - Getting started: + - getting-started/index.md + - Deploy Machine: getting-started/machines.md + - Installer: getting-started/installer.md + - Setup Networking: getting-started/networking.md + - Provision Secrets & Passwords: getting-started/secrets.md + - Backup & Restore: getting-started/backups.md + - Flake-parts: getting-started/flake-parts.md + - Templates: templates/index.md + - Contributing: contributing.md + +theme: + name: material + features: + - navigation.instant + - navigation.tabs + icon: + repo: fontawesome/brands/git + + palette: + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/weather-night + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/weather-sunny + name: Switch to light mode + +# extra_css: +# - stylesheets/extra.css + +plugins: + - search diff --git a/docs/shell.nix b/docs/shell.nix new file mode 100644 index 000000000..a4728b7f9 --- /dev/null +++ b/docs/shell.nix @@ -0,0 +1 @@ +{ docs, pkgs, ... }: pkgs.mkShell { inputsFrom = [ docs ]; } diff --git a/flake.nix b/flake.nix index 343c23d27..991637437 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,7 @@ (import ./flakeModules/clan.nix inputs.self) ./devShell.nix ./docs/flake-module + ./docs/flake-module.nix ./formatter.nix ./lib/flake-module.nix ./nixosModules/flake-module.nix From 60f2bf54c328e4b7a9d8e93be72edb1ceb4fdad8 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Apr 2024 15:32:51 +0200 Subject: [PATCH 02/12] add instructions to live reload docs --- CONTRIBUTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..d2c520886 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +# Contributing to cLAN + +## Live-reloading documentation + +Enter the `docs` directory: + +```shell-session +cd docs +``` + +Enter the development shell or enable `direnv`: + +```shell-session +direnv allow +``` + +Run a local server: + +```shell-session +mkdocs serve +``` From e04e4e4fdbf8849d18d352f09936c4c680dbd277 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Apr 2024 15:41:33 +0200 Subject: [PATCH 03/12] make "Getting Started" the start page --- docs/docs/{getting-started => }/index.md | 0 docs/mkdocs.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/docs/{getting-started => }/index.md (100%) diff --git a/docs/docs/getting-started/index.md b/docs/docs/index.md similarity index 100% rename from docs/docs/getting-started/index.md rename to docs/docs/index.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index de2f63147..a5fcfb91f 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -28,7 +28,7 @@ exclude_docs: | nav: - Getting started: - - getting-started/index.md + - index.md - Deploy Machine: getting-started/machines.md - Installer: getting-started/installer.md - Setup Networking: getting-started/networking.md From d4f10c34c48c4507c4e25abaeccc1203800a7e5e Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Apr 2024 15:45:19 +0200 Subject: [PATCH 04/12] fix up title --- docs/mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index a5fcfb91f..b943a2747 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Design +site_name: cLAN documentation site_url: https://docs.clan.lol repo_url: https://git.clan.lol/clan/clan-core/ repo_name: clan-core From ecd48df49683d7d5ac8517bff7ef7c528c400ef8 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 15:49:13 +0200 Subject: [PATCH 05/12] worklow: disable link checking, this is done by mkDocs --- .gitea/workflows/checks.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitea/workflows/checks.yaml b/.gitea/workflows/checks.yaml index 1ad904868..8c9caaba6 100644 --- a/.gitea/workflows/checks.yaml +++ b/.gitea/workflows/checks.yaml @@ -10,11 +10,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: nix run --refresh github:Mic92/nix-fast-build -- --no-nom --eval-workers 10 - check-links: - runs-on: nix - steps: - - uses: actions/checkout@v3 - - run: nix run --refresh --inputs-from .# nixpkgs#lychee . checks-impure: runs-on: nix steps: From 28773725ecbb3325d93e15240325ce1fc141590c Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 15:57:49 +0200 Subject: [PATCH 06/12] docs: fix links --- docs/docs/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index afd8816b4..0528d4724 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -7,7 +7,7 @@ Welcome to your simple guide on starting a new Clan project! We've put together a straightforward guide to help you out: - [**Starting with a New Clan Project**](#starting-with-a-new-clan-project): Create a new Clan from scratch. -- [**Integrating Clan using Flake-Parts**](flake-parts.md) +- [**Integrating Clan using Flake-Parts**](getting-started/flake-parts.md) --- @@ -80,7 +80,7 @@ Open the `flake.nix` file and set a unique `clanName` if you want you can also s **Right now clan assumes that you already have NixOS running on the target machine.** -If that is not the case you can use our [installer image](installer.md) that automatically generates an endpoint reachable over TOR with a random ssh password. +If that is not the case you can use our [installer image](getting-started/installer.md) that automatically generates an endpoint reachable over TOR with a random ssh password. On the remote execute: 1. Generate a hardware-config.nix @@ -107,11 +107,11 @@ On the remote execute: ``` ### **Next Steps** -Ready to expand? Explore how to install a new machine with the helpful documentation [here](machines.md). +Ready to expand? Explore how to install a new machine with the helpful documentation [here](getting-started/machines.md). Ready to explore more? -- **Adding New Machines to your setup**. [Following our templates](../templates/index.md) +- **Adding New Machines to your setup**. [Following our templates](templates/index.md) -- **Use a USB drive to Set Up Machines**: Setting up new computers remotely is easy with a USB stick. [Learn how](machines.md). +- **Use a USB drive to Set Up Machines**: Setting up new computers remotely is easy with a USB stick. [Learn how](getting-started/machines.md). --- From 445d5478146eeca656970b94bf148ee3d1e07f33 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 16:04:48 +0200 Subject: [PATCH 07/12] remove checks --- docs/flake-module.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/flake-module.nix b/docs/flake-module.nix index 0d07108d1..eabb1498e 100644 --- a/docs/flake-module.nix +++ b/docs/flake-module.nix @@ -7,7 +7,5 @@ packages = { docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; }; }; - - checks = self'.packages.clan-cli.tests; }; } From 43102906aa6ca6a1c9bc7d6695d62c6dd19af341 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 16:20:33 +0200 Subject: [PATCH 08/12] disable module docs until migrated --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 991637437..b7cc3f3ec 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,8 @@ ./flakeModules/flake-module.nix (import ./flakeModules/clan.nix inputs.self) ./devShell.nix - ./docs/flake-module + # TODO: migrate this @davHau + # ./docs/flake-module ./docs/flake-module.nix ./formatter.nix ./lib/flake-module.nix From 30663d563d3dcce5a64ce40ef9f589db4e9a14e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 12 Apr 2024 16:34:33 +0200 Subject: [PATCH 09/12] fix build on macos --- docs/default.nix | 3 --- docs/mkdocs.yml | 1 - 2 files changed, 4 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 28fb890e3..ce218538a 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -9,9 +9,6 @@ pkgs.stdenv.mkDerivation { ++ (with pkgs.python3Packages; [ mkdocs mkdocs-material - mkdocs-drawio-exporter - mkdocs-swagger-ui-tag - plantuml-markdown ]); buildPhase = '' diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index b943a2747..18a4d49dd 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -17,7 +17,6 @@ markdown_extensions: - pymdownx.highlight: use_pygments: true - pymdownx.superfences - - plantuml_markdown - toc: title: On this page From c3f2c548a6adfa0cbb4c915433cde736e2c5fad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 12 Apr 2024 16:37:50 +0200 Subject: [PATCH 10/12] add deploy script for homepage --- docs/deploy-docs.nix | 35 +++++++++++++++++++++++++++++++++++ docs/flake-module.nix | 8 +++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 docs/deploy-docs.nix diff --git a/docs/deploy-docs.nix b/docs/deploy-docs.nix new file mode 100644 index 000000000..a03176cbf --- /dev/null +++ b/docs/deploy-docs.nix @@ -0,0 +1,35 @@ +{ + writeShellScriptBin, + coreutils, + openssh, + rsync, + lib, + docs, +}: + +writeShellScriptBin "deploy-docs" '' + export PATH="${ + lib.makeBinPath [ + coreutils + openssh + rsync + ] + }" + + if [ -n "$SSH_HOMEPAGE_KEY" ]; then + echo "$SSH_HOMEPAGE_KEY" > ./ssh_key + chmod 600 ./ssh_key + sshExtraArgs="-i ./ssh_key" + else + sshExtraArgs= + fi + + rsync \ + -e "ssh -o StrictHostKeyChecking=no $sshExtraArgs" \ + -a ${docs}/ \ + www@clan.lol:/var/www/docs.clan.lol + + if [ -e ./ssh_key ]; then + rm ./ssh_key + fi +'' diff --git a/docs/flake-module.nix b/docs/flake-module.nix index eabb1498e..13e5990a1 100644 --- a/docs/flake-module.nix +++ b/docs/flake-module.nix @@ -1,11 +1,17 @@ { inputs, ... }: { perSystem = - { self', pkgs, ... }: + { + config, + self', + pkgs, + ... + }: { devShells.docs = pkgs.callPackage ./shell.nix { inherit (self'.packages) docs; }; packages = { docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; }; + deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; }; }; }; } From 4d75feea65476eddbf20e52cda29ac71e23279bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 12 Apr 2024 16:39:56 +0200 Subject: [PATCH 11/12] deploy-docs: fail on error --- docs/deploy-docs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/deploy-docs.nix b/docs/deploy-docs.nix index a03176cbf..65a66fc27 100644 --- a/docs/deploy-docs.nix +++ b/docs/deploy-docs.nix @@ -8,6 +8,7 @@ }: writeShellScriptBin "deploy-docs" '' + set -eux -o pipefail export PATH="${ lib.makeBinPath [ coreutils From 70cdf2387532fde6b35eac688bf517f2982598bd Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 12 Apr 2024 17:11:47 +0200 Subject: [PATCH 12/12] docs: add theming --- docs/docs/static/logo.png | Bin 0 -> 1512 bytes docs/docs/stylesheets/extra.css | 5 +++++ docs/mkdocs.yml | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 docs/docs/static/logo.png create mode 100644 docs/docs/stylesheets/extra.css diff --git a/docs/docs/static/logo.png b/docs/docs/static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..39298fb7ddcc23bb319d35eee3bb92d918fa89fd GIT binary patch literal 1512 zcmVP)66J1)zt47*$Q zLnB*?)>^njaZZP^DL}fa&F9!uO%^F2>!$vCQz;Q0DjFRFU;;QT>DTG;Z@u{nn=RS> zMxUBtOs&B|znN{mo5N^)QxI?>BQ!t%EyZaSo;eyQ$({g^;d^^kAZYo+XHVJK!5u^3 zye&AR#OD&~Uu*Nvln9|l>WH2d7yiUL9cE10+Hon8W6ToU17(M#*P>|G-sth2eF#xEw z^PwKRz&T3UJx-;;8ngt2-lP0-fEJevsJ#dBsi*(I0~~|XQ(F9jhFG12xpq zd_bSlVE)u|-pf8u=<|oXe#CPMSfWt+hzN8S4iM}#3X>uv8ri6baEhTMEcb*VP^u00 z#a^3#q4l{U#CNWZbBh_>Lc-!E7ifcT4Qp+GWe9@wf;ytDd!7w4$p2RA4a)SHJ4~Kc z?~&vXhO`%t-BS<8Wb?jMT12E{R;by^`Xdm}Nit$2Cv8l680>$uGXR5O&VfBMC=zv@ zJXbUgQ-oHJ5L{731YpJnCtD;4y|fzuwuFZWQJf3y_fk$MY|3tv4j>439`7)-fHOzt zfZ3OuAY$9D1)+8g)H6zfbPL}6M35H{UKFoVw1$C_JaCDuoXwxlOP zd2of#297b=^==~wt=9TfVPoy>raFR7Ryuy4J>jrmA#Z^NmMrioH|mOkJtqqZ+e7Pp zqbKamEn)4ysp|#LTf+@6SX}26_6&wn2ZvM!-5^-*UT|N+!8xHPp4&3cuF4dpUji}s zityD$Dm4BGmebs#LQ$18y;mVA5~#Px5|7kE5H3p*GM{;v?I^^m4D%P+K5#z-iQCJb z<*&|D=oC;uCC~2I5+>+B83HR2$OQ$sVDtrWyCg&dY;9pmZ!PdRN1`Ny<(^%qOL750 zB7i*m*x3rK~#;*V&gpNDY=_ z;K|#)0ccz$X`LuB_y~og&{{fN=gw0SuUUAmlQVTJ00v*-K`XHU0D2xnkjhi);ery4 zrsAmIQN;qFWacinn77^q02Vv0Or%r>&?=Uq8M{Cu(nz>8j_+7$<7W25ve@$P9ZKVbGaLELY2HGk#hA&PF>gXQueZB8&XxK0D3Ia z;0o1W8wh<81(jv(k&)7O8ZcMp^5p2LC)Y&8t~ac9kWz3KSe){zPu(FBBYBf#UQ?hj zSd;5K^}wXYw33@<@+w}mQ$NKLhvfMiWeE$KY;n2@hJL`G*OoxNcK<2XVZDnq?-?ye zLgdaQE{Xjuv0n)Qk1@IRbgjB1`RDyY^(Tt^