Skip to content

docs: add package for building zim archive#1607

Closed
snoweuph wants to merge 1 commit into
NotAShelf:mainfrom
snoweuph:feat/docs/zim
Closed

docs: add package for building zim archive#1607
snoweuph wants to merge 1 commit into
NotAShelf:mainfrom
snoweuph:feat/docs/zim

Conversation

@snoweuph

Copy link
Copy Markdown
Collaborator

This adds a docs-zim package, which can be hosted via nixos services.kiwix-serve

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-zim (added in this MR)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

🚀 Live preview deployed from 01d49ca

View it here:

Debug Information

Triggered by: snoweuph

HEAD at: feat/docs/zim

Reruns: 3050

@snoweuph snoweuph marked this pull request as ready for review May 20, 2026 22:39
Comment thread docs/manual.nix
mkdir -p $out/share/doc
cp -r build/* $out/share/doc/

cp ./logo.png $out/share/doc/assets/logo.png

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would've put it in the static folder, but its out of the source scope of the package.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment.

Comment thread flake/packages.nix

zimwriterfs \
--welcome 'index.html' \
--illustration 'assets/logo.png' \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a non-optional field 💀 and it has to be a png.

@snoweuph

Copy link
Copy Markdown
Collaborator Author

rebased

github-actions Bot pushed a commit that referenced this pull request May 20, 2026
@NotAShelf

Copy link
Copy Markdown
Owner

good news for the 3 people using ZIM archives

@snoweuph

Copy link
Copy Markdown
Collaborator Author

rebased

github-actions Bot pushed a commit that referenced this pull request May 21, 2026

@NotAShelf NotAShelf left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure how I feel about the necessity of this, but let's give this a shot anyway. Left some comments.

Comment thread docs/manual/logo.png

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to duplicate this? I think you can:

  1. Move README.md and nvf-logo-work.svg to the docs directory
  2. Reference them instead

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It requires a PNG. So i would need to use imagemagick for conversions.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It requires a PNG. So i would need to use imagemagick for conversions.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also put a PNG in the assets dir.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the png has to be in the zim source and relative to it 💀

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Comment thread docs/manual.nix
mkdir -p $out/share/doc
cp -r build/* $out/share/doc/

cp ./logo.png $out/share/doc/assets/logo.png

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment.

Comment thread flake/packages.nix
fi
'';

docs-zim = pkgs.stdenv.mkDerivation {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be stdenvNoCC since it doesn't need a C compiler.

Comment thread flake/packages.nix

buildInputs = [pkgs.zim-tools];

installPhase = ''

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use buildCommand here, or disable each unused phase like you did with dontUnpack.

Comment thread flake/packages.nix
Comment on lines +135 to +139
--title 'NVF Manual' \
--description 'nvf is a modular and extensible Neovim configuration framework built for Nix' \
--longDescription 'nvf is a highly modular, configurable, extensible and easy to use Neovim configuration framework built for and designed to be used with Nix. Boasting flexibility, robustness and ease of use (among other positive traits), this project allows you to configure a fully featured Neovim instance with a few lines of Nix while leaving all kinds of doors open for integrating Lua in your configurations whether you are a beginner or an advanced user.' \
-c 'NotAShelf and NVF Contributors' \
-p 'NotAShelf and NVF Contributors' \

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to make this into a JSON/TOML manifest that ndg can use and can be parsed again here.

@snoweuph

Copy link
Copy Markdown
Collaborator Author

Like how I talked about this on matrix, I will move this into ndg wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants