Malix
December 2, 2025, 7:15pm
1
Hello everyone!
I require help to package ChartDB
Database diagrams editor that allows you to visualize and design your DB with a single query.
It is a recent but very popular database diagrams and schema editor TypeScript web application distributed as a cloud SaaS and a docker container image (the frontend being displayed in a localhost web browser interface)
It surely might be possible to wrap it in a nixpkgs / nix flake from source without docker, but I have no idea how
After digging a bit deeper, it seems that it is static (doesn’t require a backend Node.js server) and architectured as a single page application (SPA).
The Docker container part is just to make Nginx serve static files and injecting environment variables through a script at runtime.
bme
December 3, 2025, 12:53am
2
I’m not saying it’s good, I’m saying I spent about 10m on it. I have no idea if it has other problems, but if you run this, localhost:8080 has stuff on it.
let
sources = import ./npins;
pkgs = import sources.nixpkgs { };
inherit (pkgs) lib;
package =
{
buildNpmPackage,
lib,
}:
buildNpmPackage rec {
pname = "chartdb";
version = lib.removePrefix src.release_prefix src.version;
src = sources.chartdb;
npmDepsHash = "sha256-nreu9QeT2lyJNkVomueifviE608YbuwesusdqGhWZqM=";
installPhase = ''
runHook preInstall
mv dist $out
runHook postInstall
'';
};
chart-db = pkgs.callPackage package { };
nginxConf = pkgs.writeText "nginx.conf" ''
daemon off;
events {
worker_connections 128;
${lib.optionalString pkgs.hostPlatform.isLinux "use epoll;"}
${lib.optionalString pkgs.hostPlatform.isDarwin "use kqueue;"}
}
http {
access_log /dev/stdout;
include ${pkgs.nginx}/conf/mime.types;
server {
listen 8080;
root ${chart-db};
location / {
try_files $uri /index.html;
}
}
}
'';
in
pkgs.writeShellScriptBin "chart-db" ''
pid=$(mktemp)
exec ${lib.getExe pkgs.nginx} -c ${nginxConf} -e /dev/stderr -g "pid $pid;"
''
EDIT:
❯ npins show
chartdb: (git release tag)
repository: https://github.com/chartdb/chartdb.git
pre_releases: false
release_prefix: v
submodules: false
version: v1.18.1
revision: 34b1a60737ac7a166f63539cf114b6d634d647b1
hash: 02jladfmxbqj861km7yf008cxjdwwqmg2hfb59s453rivmlh0f0y
frozen: false
nixpkgs: (Nix channel)
name: nixpkgs-unstable
url: https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre905319.f720de590661/nixexprs.tar.xz
hash: 07n4hhch0j6n69b0zchdjg0l80z2xrdk7k57ykv90cvhklim5dz1
frozen: false
1 Like
Malix
January 1, 2026, 8:30pm
3
Done
master ← Malix-Labs:chartdb
opened 01:39AM - 23 Dec 25 UTC
feat chartdb
- https://chartdb.io/
- https://github.com/chartdb/chartdb
…
## Things done
- Built on platform:
- [x] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- Tested, as applicable:
- [ ] [NixOS tests] in [nixos/tests].
- [ ] [Package tests] at `passthru.tests`.
- [ ] Tests in [lib/tests] or [pkgs/test] for functions and "core" functionality.
- [ ] Ran `nixpkgs-review` on this PR. See [nixpkgs-review usage].
- [ ] Tested basic functionality of all binary files, usually in `./result/bin/`.
- Nixpkgs Release Notes
- [ ] Package update: when the change is major or breaking.
- NixOS Release Notes
- [ ] Module addition: when adding a new NixOS module.
- [ ] Module update: when the change is significant.
- [x] Fits [CONTRIBUTING.md], [pkgs/README.md], [maintainers/README.md] and other READMEs.
[NixOS tests]: https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests
[Package tests]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests
[nixpkgs-review usage]: https://github.com/Mic92/nixpkgs-review#usage
[CONTRIBUTING.md]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md
[lib/tests]: https://github.com/NixOS/nixpkgs/blob/master/lib/tests
[maintainers/README.md]: https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md
[nixos/tests]: https://github.com/NixOS/nixpkgs/blob/master/nixos/tests
[pkgs/README.md]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md
[pkgs/test]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/test
---
Add a :+1: [reaction] to [pull requests you find important].
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc
Note that this is only its static file.
A NixOS / Home Manager module would be needed to run it (like Excalidraw)