From 67c169884d1adc819cb5bbb6ee75209cef7450ff Mon Sep 17 00:00:00 2001 From: osbm Date: Sun, 2 Nov 2025 18:29:39 +0300 Subject: [PATCH] add documentation --- .github/workflows/docs.yml | 33 +++++++++++++++++++++++++++++++++ docs/book.toml | 5 +++++ docs/src/README.md | 1 + flake.nix | 14 +++++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/book.toml create mode 100644 docs/src/README.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..7c3d573 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,33 @@ +name: Build Documentation + +on: + push: + branches: + - main + workflow_dispatch: + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Nix + uses: cachix/install-nix-action@v31 + + - name: Build documentation with Nix + # Use bash because some Nix examples assume bash; the runner provides it. + run: | + # Build the documentation package from the flake. Adjust system if needed. + nix build .#packages.x86_64-linux.documentation --no-link + + - name: Upload built docs + uses: actions/upload-artifact@v4 + with: + name: site + path: result diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 0000000..be76a10 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,5 @@ +[book] +title = "nixapks" +authors = ["osbm"] +description = "A collection of Nix derivations for Android APKs" + diff --git a/docs/src/README.md b/docs/src/README.md new file mode 100644 index 0000000..5ab2f8a --- /dev/null +++ b/docs/src/README.md @@ -0,0 +1 @@ +Hello \ No newline at end of file diff --git a/flake.nix b/flake.nix index e64e38b..ebbba14 100644 --- a/flake.nix +++ b/flake.nix @@ -30,8 +30,20 @@ }; }; myLib = pkgs.callPackage ./lib { inherit inputs; }; + base = myLib.byNameOverlay ./apks; + documentation = pkgs.stdenv.mkDerivation { + pname = "nixapks-docs"; + version = "0.0.1"; + src = ./docs; + buildInputs = with pkgs; [ mdbook ]; + buildPhase = '' + mdbook build --dest-dir $out + ''; + }; in - myLib.byNameOverlay ./apks + # Merge the generated documentation package into the packages set so + # you can build it via `nix build .#packages..documentation`. + base // { documentation = documentation; } ); devShells = forAllSystems (system: