Skip to content

pkgs(bonfire): init at 1.0.1-beta.11#1812

Merged
imincik merged 4 commits into
ngi-nix:mainfrom
ju1m:bonfire
Jan 12, 2026
Merged

pkgs(bonfire): init at 1.0.1-beta.11#1812
imincik merged 4 commits into
ngi-nix:mainfrom
ju1m:bonfire

Conversation

@ju1m
Copy link
Copy Markdown

@ju1m ju1m commented Nov 14, 2025

This PR packages Bonfire. It is ready for reviewing.
For the service, see stacked PR #1871

Meta
I am editing the intro message to match with the current state of this PR.

State
Build with:

nix -L build -f . bonfire.social

RoadMap

  • Fix more dependencies.
  • Rename to bonfire-app?
  • Enable WITH_IMAGE_VIX to use evision/opencv.
  • Add a passthru.updateScript to run deps_nix.
  • Get bonfire to not crash at stratup for obvious reasons due to its packaging
  • Ping relevant people.
  • Test env.FLAVOUR="open_science"
  • Fix buildMix/mixRelease, and test them in NGIpkgs before trying to push them into Nixpkgs.

Pings

Related

Upstream

@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 14, 2025

  • Drop deps/mjml.nix leftover from before using deps_nix; deps_nix manages the Rust part correctly alone.

Comment thread pkgs/by-name/bonfire/extensions/open_science/deps.nix
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 15, 2025

  • Remove projects/bonfire/ to do that in another PR
  • Move appConfigPath in another location
  • Fix dependency bonfire_federate_activitypub
  • Fix dependency bonfire_ui_me
  • Fix typo in comments
  • Fix/workaround bonfire crash at startup when failing to load some .beam modules, due to bonfire pinning git repositories directly, and deps_nix not setting version for them. Yes…

@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 16, 2025

@fishinthecalculator
Copy link
Copy Markdown

awesome stuff @ju1m , are you also working on a NixOS module for Bonfire? I think a lot of code from https://github.com/bonfire-networks/bonfire-nix could be reused, in fact if you are not I can adapt the Bonfire flake to use your packages.

@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 18, 2025

  • Add a passthru.updateScript to run deps_nix. To be used with update bonfire. Note that gitUpdater downgrades -unstable versions. So if you want to test, comment-out gitUpdater until there's a new release of bonfire.
  • Enable WITH_IMAGE_VIX to use evision/opencv.
  • Update to bonfire-1.0.0-unstable-2025-11-17 to avoid packaging its closed-source appsignal dependency.
  • Expose passthru.appConfigPath.
  • Remove version workaround now that deps_nix has a proper fix.

@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 18, 2025

@fishinthecalculator, thanks for your support, yes I'm slowly coming to the service part that I'll do in another PR, but first I'd like to finish this PR ie. get to the point where bonfire does not crash at startup for obvious reasons due to its packaging. Big thanks for your work on the service, I cannot tell you what I'll reuse or not yet, but I'll keep you posted!

@ju1m ju1m changed the title pkgs(bonfire): init at v1.0.0 pkgs(bonfire): init at v1.0.0-unstable-2025-11-17 Nov 18, 2025
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 19, 2025

Changes

State

result/bin/bonfire start still crashes at startup, but on a new error:

ERROR! the application :mime has a different value set for key :extensions during runtime compared to compile time. Since this application environment entry was marked as compile time, this difference can lead to different behavior than expected:

  * Compile time value was set to: %{"zip" => "application/zip", "livemd" => "text/markdown", "mov" => "video/quicktime", "webm" => "audio/webm", "3g2" => "video/3gpp2", "csv" => "text/csv", "ogv" => "video/ogg", "avi" => "video/x-msvideo", "text" => "text/plain", "mobi" => "application/x-mobipocket-ebook", "m4a" => "audio/mp4", "activity+json" => "application/activity+json", "bzip2" => "application/x-bzip2", "jetpack" => "text/jetpack", "webp" => "image/webp", "m1v" => "video/mpeg", "asc" => "text/plain", "mkd" => "text/markdown", "png" => "image/png", "markdown" => "text/markdown", "mpeg" => "video/mpeg", "txt" => "text/plain", "json" => "application/json", "wav" => "audio/wav", "7z" => "application/x-7z-compressed", "mpg" => "video/mpeg", "3gp" => "video/3gpp", "gz" => "application/gzip", "ld+json" => "application/ld+json", "oga" => "audio/ogg", "rar" => "application/vnd.rar", "vcs" => "application/ics", "mpg4" => "video/mp4", "jpeg" => "image/jpeg", "prc" => "application/x-mobipocket-ebook", "vcf" => "text/x-vcard", "apng" => "image/apng", "mkv" => "application/x-matroska", "flac" => "audio/flac", "rtf" => "application/rtf", "swiftui" => "text/swiftui", "jpg" => "image/jpeg", "styles" => "text/styles", "mp2" => "audio/mpeg", "md" => "text/markdown", "ics" => "application/ics", "gif" => "image/gif", "aac" => "audio/aac", "mpe" => "video/mpeg", "log" => "text/plain", ...}
  * Runtime value was set to: %{"livemd" => "text/markdown", "mov" => "video/quicktime", "webm" => "audio/webm", "3g2" => "video/3gpp2", "csv" => "text/csv", "ogv" => "video/ogg", "avi" => "video/x-msvideo", "text" => "text/plain", "mobi" => "application/x-mobipocket-ebook", "m4a" => "audio/mp4", "activity+json" => "application/activity+json", "webp" => "image/webp", "m1v" => "video/mpeg", "asc" => "text/plain", "mkd" => "text/markdown", "png" => "image/png", "markdown" => "text/markdown", "mpeg" => "video/mpeg", "txt" => "text/plain", "json" => "application/json", "wav" => "audio/wav", "rss+xml" => "application/rss+xml", "mpg" => "video/mpeg", "3gp" => "video/3gpp", "ld+json" => "application/ld+json", "oga" => "audio/ogg", "vcs" => "application/ics", "mpg4" => "video/mp4", "jpeg" => "image/jpeg", "prc" => "application/x-mobipocket-ebook", "vcf" => "text/x-vcard", "apng" => "image/apng", "mkv" => "application/x-matroska", "flac" => "audio/flac", "rtf" => "application/rtf", "jpg" => "image/jpeg", "mp2" => "audio/mpeg", "md" => "text/markdown", "ics" => "application/ics", "gif" => "image/gif", "aac" => "audio/aac", "mpe" => "video/mpeg", "log" => "text/plain", "atom+xml" => "application/atom+xml", "epub" => "application/epub+zip", "mpa" => "video/mpeg", "svg" => "image/svg+xml", "ogg" => "audio/ogg", "jrd+json" => "application/jrd+json", "m2v" => "video/mpeg", ...}

@imincik imincik moved this to In progress in Nix@NGI Nov 25, 2025
@ju1m ju1m force-pushed the bonfire branch 2 times, most recently from 031fb42 to e8c8333 Compare November 27, 2025 04:52
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 27, 2025

Changes

  • Cleanup bonfire_common by dropping a previous fix no longer needed with the global src workaround in buildMix.
  • Package bonfire_editor_milkdown's yarn assets.
  • Package bonfire_geolocate's yarn assets.
  • Package bonfire_ui_common's yarn assets.
  • Cleanup bonfire_ui_common by dropping a previous fix no longer needed with the global src workaround in buildMix.
  • Fix ex_cldr by not dropping previousAttrs.postInstall.
  • Fix iconify_ex.
  • Package iconify_ex's yarn assets.
  • Make lazy_html depend on fine.src instead of "${fine}/src", it was required when I was not able to replace $out/src, but now it just pulls fine.src for nothing so I'll likely revert.
  • Include appConfigPath inside a broader bonfireSetup that includes configs from the flavour.
    • Tip: bonfire has fake libraries, eg. attempting to compile bonfire.mixNixDeps.bonfire_ui_common is meaningless, it has to be built inside bonfire-app due to paths like ../../../../.
  • Workaround mix compile.surface (a compiler generating *.hooks.js from Elixir files) depending on Elixir dependencies being built in $out instead of ephemeral $src (sic). See detailed comments inlined. Related upstream issue is: Fix compiler when using ERL_COMPILER_OPTIONS=deterministic surface-ui/surface#762
    • Tip: to troubleshoot this problem requiring to dive into mix internals, learning a bit of Elixir and using the interactive prompt iex (eg. iex --erl "-kernel shell_history enabled" -S mix compile --no-deps-check) helped a lot.
    • Tip: when blocked, being able to build the package successfully out of nix is a must to keep hope and get a base from which to investigate what had to be done and when, most of the ~1300LoC justfile is bringing no added-value to the nix package, I've only kept just flavour_make_symlinks so far, and it may be replaced entirely at some point in the future if bonfire's way to install a flavour proves to be stable.
  • Add a pkgs/by-name/bonfire/test.sh to test the package. This is only to help reviewers, I'll remove it when introducing the service.
  • Make updateScript able to update yarnOfflineCaches too, using nurl --expr to compute the hash of those fixed-output derivations. I chose to put the hash in a separated file out of simplicity (avoid the need to call substituteInPlace to replace the old hash).
  • Replace mix bonfire.install.copy_migrations --force with a simple for loop, because I was unable to make it work correctly (it was not installing all the SQL migrations). Yet another subtle bug is lurking here, and mix makes it too hard for me to troubleshoot what it is without spending sleepless nights on it again.

State

With a postgresql server configured correctly, pkgs/by-name/bonfire/test.sh builds and run bonfire in its social flavour, accessible in a Web browser at http://localhost:4000. Yurray!

ToDo

  • Support other flavours. But probably in another PR, because I don't want to be drained by yet another fight with mix.

@ju1m ju1m marked this pull request as ready for review November 27, 2025 05:55
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Nov 28, 2025

Changes

  • Fix fetchYarnDeps's name instead of pname, because it overrides it.
  • Fix lazy_html to use ${fine}/src instead of ${fine.src}.
  • Remove commented debug code.
  • Use the existence of yarnOfflineCache to select yarn dependencies.
  • Minor cleanups

@ju1m ju1m mentioned this pull request Dec 5, 2025
4 tasks
@ju1m ju1m changed the title pkgs(bonfire): init at v1.0.0-unstable-2025-11-17 pkgs(bonfire): init at 1.0.1-alpha.28 Dec 24, 2025
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Dec 24, 2025

Changes

RoadMap

  • Fix buildMix/mixRelease, and test them in NGIpkgs before trying to push them in Nixpkgs.

Remark

  • I'm sorry I rebased upon latest main before pushing instead of doing it in a separate force-push, this makes GitHub's force-pushed/Compare buttons even more painful to read than they already notoriously are. If reviewing locally, you may use git range-diff --no-dual-color 815c607e8cd4677b8782d8c9a1818654749da92a b763b6e 8dbdd30 for a workaround.

@ju1m ju1m force-pushed the bonfire branch 3 times, most recently from b1ca80d to 8798992 Compare January 7, 2026 00:58
@ju1m ju1m force-pushed the bonfire branch 2 times, most recently from aef8a95 to 1407b06 Compare January 7, 2026 02:15
@ju1m ju1m changed the title pkgs(bonfire): init at 1.0.1-alpha.28 pkgs(bonfire): init at 1.0.1-beta.11 Jan 7, 2026
@ju1m
Copy link
Copy Markdown
Author

ju1m commented Jan 7, 2026

Changes

  • Support for other flavours (only open_science builds at the moment, see Cannot setup the community flavour in non-interactive mode bonfire-networks/bonfire-app#1737)
  • Improve resilience and clarify update scripts, moving the reusable part into profiles/pkgs/development/beam-modules/mix-update.nix.
  • Document update process (see manuals/Contributor/How_to/update/pkgs/bonfire.flavour.md in doc: init #1891)
  • Remove import-from-derivation by vendoring-in Cargo.lock files, hence deps_nix's support for Rust is not longer used.
  • Vendor-in Nixpkgs' pkgs/development/beam-modules/{build-mix,mix-release}.nix in profiles/ and make them use lib.extendMkDerivation to provide finalAttrs, rewrite everything to use finalAttrs as an open-recursive-let scoped to a package, to be overrided with overrideAttrs (much more resilient than override which does not survive callPackage, see manuals/Contributor/How_to/reuse/a_package/with_different_arguments/when_lib_makeOverridable_is_nested_into_another.md).
  • Init internal lib that does not require users to do anything for modules to use it (ie. modules use direct import:
lib = import ../../../../lib/default.nix { inherit (args) lib; };

instead of the user having to overlay lib has previously tried in #1927)

  • Add lib.types.credential
  • Add lib.nixos.systemd.serviceConfig.loadCredential to properly support LoadCredential= or LoadCredentialEncrypted=
  • Move pkgs/by-name/bonfire/package.nix to pkgs/by-name/bonfire/generic.nix
    and write a new pkgs/by-name/bonfire/package.nix using lib.recurseIntoAttrs to support multiple flavours of bonfire.

State

nom build -f. bonfire.social

builds bonfire.ember, bonfire.social and bonfire.open_science.

RoadMap

  • Support Unix socket whenever upstream will. Code is already there in comments to do so.
  • See what to do about shell in profiles/pkgs/development/beam-modules/build-mix.nix.
  • Review and merge this PR

@imincik
Copy link
Copy Markdown
Contributor

imincik commented Jan 12, 2026

@ju1m , I can't see project metadata in this PR - this PR shouldn't close #1765 . Metadata is in #1871 .

Copy link
Copy Markdown
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

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

Julien, great thanks for your work ! I am not very competent to review this PR, but I went through all files and I can't see any obvious blocker.

@imincik
Copy link
Copy Markdown
Contributor

imincik commented Jan 12, 2026

@eljamm , are you OK with merging this PR now ?

@imincik imincik merged commit 119913d into ngi-nix:main Jan 12, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Nix@NGI Jan 12, 2026
@ju1m ju1m deleted the bonfire branch January 12, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bonfire: Implement an update script for bonfire bonfire: Package bonfire for NGIpkgs

3 participants