Created
July 21, 2026 10:10
-
-
Save teh/0cb575bcb171d56a07b5f6fbf9efd910 to your computer and use it in GitHub Desktop.
open-bamboo-networking default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let | |
| pkgs = import <nixpkgs> {}; | |
| inherit (pkgs) lib stdenv cmake pkg-config git openssl curl zlib uthash fetchFromGitHub; | |
| obnVersion = "02.05.00.66"; | |
| clientType = "bambu_studio"; | |
| mosquitto-src = fetchFromGitHub { | |
| owner = "eclipse"; | |
| repo = "mosquitto"; | |
| rev = "v2.1.2"; | |
| hash = "sha256-Zl55yjuzQY2fyaKs/zLaJ7a3OONKTDQPaT+DpPURdZI="; | |
| }; | |
| cjson-src = fetchFromGitHub { | |
| owner = "DaveGamble"; | |
| repo = "cJSON"; | |
| rev = "v1.7.18"; | |
| hash = "sha256-UgUWc/+Zie2QNijxKK5GFe4Ypk97EidG8nTiiHhn5Ys="; | |
| }; | |
| in | |
| stdenv.mkDerivation { | |
| pname = "open-bamboo-networking"; | |
| version = "1.1.0"; | |
| src = lib.cleanSource ./.; | |
| nativeBuildInputs = [ | |
| cmake | |
| pkg-config | |
| git | |
| ]; | |
| buildInputs = [ | |
| openssl | |
| curl | |
| zlib | |
| uthash | |
| ]; | |
| cmakeFlags = [ | |
| "-DOBN_VERSION=${obnVersion}" | |
| "-DOBN_CLIENT_TYPE=${clientType}" | |
| "-DOBN_PATCH_CLIENT_CONF=OFF" | |
| "-DOBN_BUILD_TESTS=OFF" | |
| "-DFETCHCONTENT_SOURCE_DIR_ECLIPSE_MOSQUITTO=${mosquitto-src}" | |
| "-DFETCHCONTENT_SOURCE_DIR_CJSON=${cjson-src}" | |
| ]; | |
| # FetchContent patches mosquitto sources in-place; copy to a writable | |
| # location so the cmake patches can apply. | |
| preConfigure = '' | |
| mosquitto_writable=$(mktemp -d) | |
| cp -r ${mosquitto-src}/* "$mosquitto_writable"/ | |
| chmod -R u+w "$mosquitto_writable" | |
| cmakeFlagsArray+=("-DFETCHCONTENT_SOURCE_DIR_ECLIPSE_MOSQUITTO=$mosquitto_writable") | |
| cjson_writable=$(mktemp -d) | |
| cp -r ${cjson-src}/* "$cjson_writable"/ | |
| chmod -R u+w "$cjson_writable" | |
| cmakeFlagsArray+=("-DFETCHCONTENT_SOURCE_DIR_CJSON=$cjson_writable") | |
| ''; | |
| meta = { | |
| description = "Open-source replacement for Bambu Studio's bambu_networking plugin"; | |
| homepage = "https://github.com/tom/open-bamboo-networking"; | |
| license = lib.licenses.agpl3Plus; | |
| platforms = lib.platforms.unix; | |
| }; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment