nakamochi daemon and gui source code
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
alex e55471e48c
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
ngui,nd: screenlock feature implementation
the screenlock use case is a way to restrict access to the touchscreen,
for example from children. it is in no way a security measure against
theft or prolonged physical access.

however, nd daemon will refuse to connect to a wifi, switch sysupdates
channel, set a new nodename or init lnd wallet during active screenlock

screenlock pin code can be enabled and disabled from the settings screen.
upon loss of the code, the only way to disable screenlock is to set
slock field to null in the nd daemon conf file.
4 days ago
doc start: initial minimal implementation 2 years ago
lib ui/driver: add Xlib support when dev-building on a linux host 2 months ago
src ngui,nd: screenlock feature implementation 4 days ago
tools zig: upgrade from 0.10.x to 0.11.0 8 months ago
.clang-format ngui: port some LVGL-based UI code from C to zig 10 months ago
.git-blame-ignore-revs git: add 2ecd44a7 to blame-ignore list 1 year ago
.gitignore repo: initial blank import of zig init-exe 2 years ago
.woodpecker.yml test: reinstate lndhc playground build 2 months ago
LICENSE license: add qeles AG to copyright holders 1 year ago ui/driver: add Xlib support when dev-building on a linux host 2 months ago
build.zig nd,ui: add a new facility to be able to change node name 1 month ago

nakamochi daemon and gui (ndg)

release build for linux/aarch64, a raspberry pi 4:

zig build -Dtarget=aarch64-linux-musl -Ddriver=fbev -Doptimize=ReleaseSafe -Dstrip

a dev build for a native arch linux host running Xorg can be compiled simply with zig build. otherwise, for macOS or non-X11 platforms use SDL2:

zig build -Ddriver=sdl2

local development

you'll need zig v0.11.x. if working on the gui, also SDL2.

note that compiling the daemon on macOS is currently unsupported since it requires some linux primitives.

compiling is expected to be as easy as

# only gui
zig build ngui
# only daemon
zig build nd
# everything at once
zig build

the output is placed in ./zig-out/bin directory. for example, to run the gui, simply execute ./zig-out/bin/ngui.

the build script has a few project-specific options. list them all with a zig build --help command. for instance, to reduce LVGL logging verbosity in debug build mode, one can set this extra build flag:

zig build ngui -Dlvgl_loglevel=warn

run all tests with

zig build test

or a filtered subset using test-filter:

zig build test -Dtest-filter=xxx

significant contributors may find adding .git-blame-ignore-revs file to their git config useful, to skip very likely irrelevant commits when browsing git blame:

git config blame.ignoreRevsFile .git-blame-ignore-revs

see also the contributing section.

CI automated checks

the CI runs code format checks, tests and builds for fbdev+evdev on aarch64 and SDL2. it requires a container image with zig and clang tools such as clang-format.

to make a new image and switch the CI to use it, first modify the ci-containerfile and produce the image locally:

podman build --rm -t ndg-ci -f ./tools/ci-containerfile \
  --build-arg ZIGURL=

then tag it with the target URL, for example:

podman tag localhost/ndg-ci

generate an access token, login to the container registry and push the image to remote:

podman login
podman push

the image will be available at

finally, delete the access token from

what's left is to update the CI build pipeline and delete the older version of the image.


to contribute, create a pull request or send a patch with git send-mail to

before sending a change, please make sure tests pass:

zig build test

and all code is formatted: zig code with zig fmt and C according to the style described by .clang-format file. if clang-format tool is installed, all formatting can be checked with:


note that only C files in src/ are formatted. leave third party libraries as is - it is easier to update and upgrade when the original style is preserved, even if it doesn't match this project.