refactor: rework nix flake

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
faukah 2025-09-07 10:49:54 +02:00 committed by Amaan Qureshi
parent e9e4316569
commit e4e643086b
No known key found for this signature in database
12 changed files with 569 additions and 655 deletions

View file

@ -1,38 +0,0 @@
{
perSystem =
{
pkgs,
lib,
src,
version,
...
}:
{
packages.docs = pkgs.stdenv.mkDerivation {
inherit src version;
pname = "tree-sitter-docs";
nativeBuildInputs = [
pkgs.mdbook
pkgs.mdbook-admonish
];
buildPhase = ''
cd docs
mdbook build
'';
installPhase = ''
mkdir -p $out/share/doc
cp -r book $out/share/doc/tree-sitter
'';
meta = {
description = "Tree-sitter documentation";
homepage = "https://tree-sitter.github.io/tree-sitter";
license = lib.licenses.mit;
};
};
};
}

33
docs/package.nix Normal file
View file

@ -0,0 +1,33 @@
{
stdenv,
lib,
version,
mdbook,
mdbook-admonish,
}:
stdenv.mkDerivation {
inherit version;
src = ./.;
pname = "tree-sitter-docs";
nativeBuildInputs = [
mdbook
mdbook-admonish
];
buildPhase = ''
mdbook build
'';
installPhase = ''
mkdir -p $out/share/doc
cp -r book $out/share/doc/tree-sitter
'';
meta = {
description = "Tree-sitter documentation";
homepage = "https://tree-sitter.github.io/tree-sitter";
license = lib.licenses.mit;
};
}