add documentation

This commit is contained in:
Osman Faruk Bayram 2025-11-02 18:29:39 +03:00
parent 00ac652a44
commit 67c169884d
4 changed files with 52 additions and 1 deletions

33
.github/workflows/docs.yml vendored Normal file
View file

@ -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

5
docs/book.toml Normal file
View file

@ -0,0 +1,5 @@
[book]
title = "nixapks"
authors = ["osbm"]
description = "A collection of Nix derivations for Android APKs"

1
docs/src/README.md Normal file
View file

@ -0,0 +1 @@
Hello

View file

@ -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.<system>.documentation`.
base // { documentation = documentation; }
);
devShells = forAllSystems (system: