110: switch docs to mkdocs r=zimbatm a=zimbatm



Co-authored-by: zimbatm <zimbatm@zimbatm.com>
This commit is contained in:
bors[bot] 2023-04-03 15:52:59 +00:00 committed by GitHub
commit 310588cb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 40 additions and 67 deletions

View File

@ -5,7 +5,7 @@ repository:
name: srvos
# A short description of the repository that will show up on GitHub
description: Server-optimized nixos configuration
description: NixOS profiles for servers
# A URL with more information about the repository
homepage: "https://numtide.github.io/srvos"

View File

@ -24,7 +24,7 @@ jobs:
- name: Build
id: build
run: |
nix build .#docs
nix build ./dev#docs --override-input srvos "path:$PWD"
echo "result=$(readlink ./result)" >> $GITHUB_OUTPUT
- name: Deploy

View File

@ -1,4 +1,4 @@
# SrvOS - NixOS for your server
# SrvOS - NixOS profiles for servers
STATUS: **experimental**

View File

@ -17,5 +17,4 @@ status = [
"nixosConfig example-roles-github-actions-runner-github-app",
"nixosConfig example-roles-nix-remote-builder",
"nixosConfig example-server",
"package docs [x86_64-linux]",
]

View File

@ -5,11 +5,11 @@ let
keys = lib.attrNames;
borsChecks =
map (name: '' "check ${name} [${system}]"'') (keys self.checks.${system})
map (name: '' "check ${name} [${system}]"'') (keys self.checks.${system} or { })
++
map (name: '' "nixosConfig ${name}"'') (keys self.nixosConfigurations)
map (name: '' "nixosConfig ${name}"'') (keys self.nixosConfigurations or { })
++
map (name: '' "package ${name} [${system}]"'') (keys self.packages.${system})
map (name: '' "package ${name} [${system}]"'') (keys self.packages.${system} or { })
;
borsTOML = pkgs.writeText "bors.toml" ''

View File

@ -5,12 +5,14 @@
inputs.nixpkgs.follows = "srvos/nixpkgs";
inputs.mkdocs-numtide.url = "github:numtide/mkdocs-numtide";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.url = "github:nix-community/flake-compat";
outputs = { self, nixpkgs, treefmt-nix, srvos, ... }:
outputs = { self, nixpkgs, mkdocs-numtide, treefmt-nix, srvos, ... }:
let
eachSystem = f:
nixpkgs.lib.genAttrs
@ -25,10 +27,18 @@
devShells = eachSystem (pkgs: {
default = pkgs.mkShellNoCC {
packages = [
mkdocs-numtide.packages.${pkgs.system}.default
pkgs.nixpkgs-fmt
treefmt.${pkgs.system}
];
};
});
packages = eachSystem (pkgs: {
docs = mkdocs-numtide.lib.${pkgs.system}.mkDocs {
name = "srvos";
src = toString srvos;
};
});
};
}

View File

@ -1,12 +0,0 @@
# Table of Content
- [Hello](./hello.md)
- [NixOS modules](./nixos.md)
- [General](./nixos/general.md)
- [Hardware](./nixos/hardware.md)
- [Mixins](./nixos/mixins.md)
- [Roles](./nixos/roles.md)
- [GitHub Action Runner](./nixos/roles/github_actions_runner.md)
- [Installation](./installation.md)
- [Hetzner Cloud](./installation/hetzner_cloud.md)
- [Design](./design.md)

View File

@ -1,6 +0,0 @@
[book]
authors = [ ]
language = "en"
multilingual = false
src = "."
title = "SrvOS - NixOS for your server"

View File

@ -1,21 +0,0 @@
{ lib
, coreutils
, runCommand
, writeShellScriptBin
, mdbook
}:
runCommand
"srvos-docs"
{
passthru.serve = writeShellScriptBin "serve" ''
set -xeuo pipefail
cd docs
workdir=$(${coreutils}/bin/mktemp -d)
trap 'rm -rf "$workdir"' EXIT
${lib.getExe mdbook} serve --dest-dir "$workdir"
'';
}
''
cp -r ${lib.cleanSource ./.}/* .
${lib.getExe mdbook} build --dest-dir "$out"
''

View File

@ -1,4 +0,0 @@
# Design
This page explains some of the design decisions that have been made trough
this project.

View File

@ -1,3 +0,0 @@
# Installation
* [Hetzner Cloud](./installation/hetzner_cloud.md)

View File

@ -1,3 +0,0 @@
## NixOS modules
All modules are defined in the repo's top-level `default.nix`

View File

@ -1,6 +0,0 @@
## Roles
Designed to take over a machine with the given role.
- [roles-github-actions-runner](./roles/github_actions_runner.md) configures [GitHub
self hosted actions runner](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) on a machine

View File

@ -18,10 +18,6 @@
"x86_64-linux"
];
packages = eachSystem ({ pkgs, ... }: {
docs = pkgs.callPackage ./docs { };
});
# generates future flake outputs: `modules.<kind>.<module-name>`
modules.nixos = import ./nixos;

23
mkdocs.yml Normal file
View File

@ -0,0 +1,23 @@
INHERIT: !ENV MKDOCS_NUMTIDE_THEME
### Site metadata ###
site_name: srvos
site_description: NixOS profiles for servers
site_url: https://numtide.github.io/srvos/
repo_name: 'numtide/srvos'
repo_url: https://github.com/numtide/srvos
edit_uri: edit/main/docs
### Navigation ###
nav:
- Hello: index.md
- NixOS modules:
- General: nixos/general.md
- Hardware: nixos/hardware.md
- Mixins: nixos/mixins.md
- Roles:
- GitHub Action Runner: nixos/roles/github_actions_runner.md
- Installation:
- Hetzner Cloud: installation/hetzner_cloud.md