Discourse package fails to build through nix-shell

Attempted to download and build the discourse nixpkg but it failed due to a seeming pnpm dependency error:

 ERR_PNPM_INVALID_DEPENDENCY_NAME  Refusing to place a dependency under /build/source/frontend/discourse-types/node_modules with the invalid alias "@types/@glimmer__component"

ERROR: pnpm failed to install dependencies

If you see ERR_PNPM_NO_OFFLINE_TARBALL above this, follow these to fix the issue:
1. Set pnpmDeps.hash to "" (empty string)
2. Build the derivation and wait for it to fail with a hash mismatch
3. Copy the 'got: sha256-' value back into the pnpmDeps.hash field

If you see ERR_PNPM_LOCKFILE_CONFIG_MISMATCH above this, try changing the pnpm version
Found 'pnpm' with version '10.34.4'

error: Cannot build '/nix/store/k90f0nxqhlyb1bym9lg5xl6pfjz4vamf-discourse-assets-2026.1.4.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/biwwabb1xl58v4ywqmmc7d4vm0sl78q3-discourse-assets-2026.1.4-node_modules
         /nix/store/jsbd94c63h63yq5xvrp27m5l1sg6667c-discourse-assets-2026.1.4-generated
         /nix/store/n278iw1v8kzswvwm8f6n6g15gkw6wb0q-discourse-assets-2026.1.4-frontend
         /nix/store/qnxglj6z2n8fn46af9rp7161634brcgk-discourse-assets-2026.1.4
       Last 25 log lines:
       > Progress: resolved 1909, reused 1263, downloaded 0, added 0
       > Progress: resolved 1909, reused 1907, downloaded 0, added 65
       > Progress: resolved 1909, reused 1909, downloaded 0, added 435
       > Progress: resolved 1909, reused 1909, downloaded 0, added 530
       > Progress: resolved 1909, reused 1909, downloaded 0, added 672
       > Progress: resolved 1909, reused 1909, downloaded 0, added 838
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1036
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1175
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1464
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1767
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1907
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1908
       > Progress: resolved 1909, reused 1909, downloaded 0, added 1909, done
       >  ERR_PNPM_INVALID_DEPENDENCY_NAME  Refusing to place a dependency under /build/source/frontend/discourse-types/node_modules with the invalid alias "@types/@glimmer__component"
       >
       > ERROR: pnpm failed to install dependencies
       >
       > If you see ERR_PNPM_NO_OFFLINE_TARBALL above this, follow these to fix the issue:
       > 1. Set pnpmDeps.hash to "" (empty string)
       > 2. Build the derivation and wait for it to fail with a hash mismatch
       > 3. Copy the 'got: sha256-' value back into the pnpmDeps.hash field
       >
       > If you see ERR_PNPM_LOCKFILE_CONFIG_MISMATCH above this, try changing the pnpm version
       > Found 'pnpm' with version '10.34.4'
       >
       For full logs, run:
         nix log /nix/store/k90f0nxqhlyb1bym9lg5xl6pfjz4vamf-discourse-assets-2026.1.4.drv
error: Cannot build '/nix/store/9n8grwvci4gd2c64i9wm5ggw5v4r63xf-discourse-2026.1.4.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/l9xhbd5scihfln5jr9vh1c6l4xznaall-discourse-2026.1.4
error: Build failed due to failed dependency

Didn’t quite see this issue anywhere and thought you all might like to know

The thing is, only Debian/Ubuntu are supported, not Nix. Is this for a development environment or for production?

this is just downloading the discourse package from nixpkgs using the nix package manager. Derivations work by essentially cloning and building a package directly from the source.

I was just ephmerally installing a package like I would any other nixOS. Not specifically for dev or production, really I wanted to see if I could use discourse in a cli. My tui browser won’t display some of the UI so I thought I’d test drive the nixpkg and see if the UX was more amenable.

Tried a simple download/build via nix and got the aforementioned error

Interesting. I believe the package isn’t officially by Discourse. A quick glance at the Maintainers does not list any member of the Discourse team that I have heard of. Plus, no Documentation about this AFAIK.

For reference: this plugin I think

ah yes that is the nixpkg maintainer(s)

the actual source is in the `let in` block

line 55:

let
  version = "2026.1.4";

  src = fetchFromGitHub {
    owner = "discourse";
    repo = "discourse";
    rev = "v${version}";
    sha256 = "sha256-kQYDKZIMsWByuCZQfUlwhoIew5QykVylRMh6xvrHIBY=";
  };
in
# ...

so it’s sourcing from `https://github.com/discourse/discourse\` and building version `2026.1.4`. The rest of the derivation is basically just build steps, where to put files, what to do with certain build errors …etc

that `src` parameter is kind of like a variable in that it is propagated down through the rest of the derivation

Also you don’t need to commit to the full nixOS to test this

the nix package manager is available for nearly any machine

`nix-shell -p discourse`

where the `nix-shell` starts a shell where whatever package(s), `-p`, are now available on the system. once the shell is closed those packages are no longer installed

I don’t have an apt analogy to describe nix as a concept but if water shapes itself to fit it’s container, nix is a container that shapes itself to fit it’s contents. The problem `nix` seeks to solve is “works on my machine” in that, if the software compiles and runs, it will compile and run via nix.

testing to see if this thread has been locked as I can’t see one of my most recent edits.

maybe the edit needs to be approved to display in the post

the thread is not locked and we are enjoying the topic and learning. Thank you for your contribution and welcome to Meta :+1: