diff --git a/.github/settings.yml b/.github/settings.yml index dc1bd04..5cea3b4 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -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" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 75d660c..69fce9e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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 diff --git a/README.md b/README.md index 6f83073..368ac88 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SrvOS - NixOS for your server +# SrvOS - NixOS profiles for servers STATUS: **experimental** diff --git a/bors.toml b/bors.toml index 03cdbc4..577177f 100644 --- a/bors.toml +++ b/bors.toml @@ -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]", ] diff --git a/checks/default.nix b/checks/default.nix index a091260..fa480bd 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -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" '' diff --git a/dev/flake.nix b/dev/flake.nix index ad96995..3478bfe 100644 --- a/dev/flake.nix +++ b/dev/flake.nix @@ -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; + }; + }); }; } diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md deleted file mode 100644 index 865f580..0000000 --- a/docs/SUMMARY.md +++ /dev/null @@ -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) diff --git a/docs/book.toml b/docs/book.toml deleted file mode 100644 index 74819dd..0000000 --- a/docs/book.toml +++ /dev/null @@ -1,6 +0,0 @@ -[book] -authors = [ ] -language = "en" -multilingual = false -src = "." -title = "SrvOS - NixOS for your server" diff --git a/docs/default.nix b/docs/default.nix deleted file mode 100644 index 4e668a6..0000000 --- a/docs/default.nix +++ /dev/null @@ -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" - '' diff --git a/docs/design.md b/docs/design.md deleted file mode 100644 index 56e726a..0000000 --- a/docs/design.md +++ /dev/null @@ -1,4 +0,0 @@ -# Design - -This page explains some of the design decisions that have been made trough -this project. diff --git a/docs/hello.md b/docs/index.md similarity index 100% rename from docs/hello.md rename to docs/index.md diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 0930d71..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,3 +0,0 @@ -# Installation - -* [Hetzner Cloud](./installation/hetzner_cloud.md) diff --git a/docs/nixos.md b/docs/nixos.md deleted file mode 100644 index a362e4b..0000000 --- a/docs/nixos.md +++ /dev/null @@ -1,3 +0,0 @@ -## NixOS modules - -All modules are defined in the repo's top-level `default.nix` diff --git a/docs/nixos/roles.md b/docs/nixos/roles.md deleted file mode 100644 index 828256e..0000000 --- a/docs/nixos/roles.md +++ /dev/null @@ -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 diff --git a/flake.nix b/flake.nix index 2875826..c3c675c 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,6 @@ "x86_64-linux" ]; - packages = eachSystem ({ pkgs, ... }: { - docs = pkgs.callPackage ./docs { }; - }); - # generates future flake outputs: `modules..` modules.nixos = import ./nixos; diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..4d083c1 --- /dev/null +++ b/mkdocs.yml @@ -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