# Discourse package fails to build through nix-shell

**URL:** https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [August 17, 2026, 10:25am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198 "2026-08-17T10:25:19Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 10:25am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/1 "2026-08-17T10:25:20Z")

</div>

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

```sh
 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

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [August 17, 2026, 10:55am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/2 "2026-08-17T10:55:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 11:04am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/3 "2026-08-17T11:04:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [August 17, 2026, 11:08am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/4 "2026-08-17T11:08:03Z")

</div>

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](https://search.nixos.org/packages?channel=26.05&query=discourse#show=discourse) I think

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 11:13am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/5 "2026-08-17T11:13:35Z")

</div>

ah yes that is the nixpkg maintainer(s)

the actual source is in the `let in` block

line 55:

```nix
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\`](https://github.com/discourse/discourse%5C%60) 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

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 11:16am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/6 "2026-08-17T11:16:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 11:29am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/7 "2026-08-17T11:29:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Andrew\_Rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_rowe/32/445877_2.png) [@Andrew\_Rowe](https://meta.discourse.org/u/Andrew_Rowe)
#### Post date: [August 17, 2026, 11:38am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/8 "2026-08-17T11:38:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 17, 2026, 9:32pm UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/9 "2026-08-17T21:32:38Z")

</div>

no worries! thanks for the clarification.

The reason I suspected some approval process is because I’d made this edit and didn’t see it come up on my end:

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/a/e/7ae560ac9fbec972c144d528fe5997be2140527a.jpeg)

I still see just the text on the left side

E: it just appeared

---

<div class="post-metadata">

### Author: ![ducks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ducks/32/518975_2.png) [@ducks](https://meta.discourse.org/u/ducks)
#### Post date: [August 17, 2026, 10:30pm UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/10 "2026-08-17T22:30:16Z")

</div>

Thanks for the report! I took a look, and this appears to be a pnpm version mismatch in the Nix package rather than a problem with the dependency hash.

Discourse `v2026.1.4` declares `pnpm@10.28.0`, while [the Nix expression](https://github.com/NixOS/nixpkgs/blob/nixos-26.05/pkgs/servers/web-apps/discourse/default.nix#L42) uses the moving `pnpm_10` package, which currently resolves to `10.34.4`. That newer pnpm version rejects some dependency aliases used by this Discourse release.

The likely Nixpkgs fix is to pin the derivation to an older compatible pnpm, possibly the existing `pnpm_10_29_2 package`, or exactly `10.28.0` and then update `pnpmDeps.hash` if necessary.

Since the Nix package is community-maintained, that fix would need to be made in Nixpkgs, but hopefully this points the maintainers in the right direction.

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 18, 2026, 11:40am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/11 "2026-08-18T11:40:02Z")

</div>

I may have jumped the gun on marking this solved as I haven’t actually tested that lol

Nixpkgs allows for overlays and overrides of it’s packages locally. I can try to implement those changes to the derivation myself when I get some time and report back my findings

---

<div class="post-metadata">

### Author: ![fuguesoft](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fuguesoft](https://meta.discourse.org/u/fuguesoft)
#### Post date: [August 18, 2026, 7:24pm UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/12 "2026-08-18T19:24:16Z")

</div>

This is as far as I got:

```nix
let
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-26.05";
  pkgs = import nixpkgs {
    config = { };
    overlays = with pkgs; [
      (final: prev: {
        discourse = prev.discourse.override (oa: {
          pnpm_10 = oa.pnpm_10.overrideAttrs (_: {
            src = fetchFromGitHub {
              owner = "pnpm";
              repo = "pnpm";
              rev = "ea870c786fc74c99bf9de644c78453b4d25a7d59";
              hash = "sha256-g+TjAW1SGuEXh04RnGZOQTLkJTHs/3zyCp/P+MzBn4c=";
            };
          });
        });

      })
    ];
  };
in

pkgs.mkShellNoCC {
  packages = with pkgs; [
    # for debug
    discourse
  ];
}

```

error:

```sh
Running phase: unpackPhase
unpacking source archive /nix/store/ci631zzm890b2dzsrxxxrg15qpbac6jy-source
source root is source
rm: cannot remove 'package/dist/vendor': No such file or directory
error: Cannot build '/nix/store/lq23pl8ycyf8myl9mynwzx9a2f2miywv-pnpm-10.34.0.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/kf62vww5jdfpr32qgxhz4qv9dkfdb0pf-pnpm-10.34.0
       Last 5 log lines:
       > structuredAttrs is enabled
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/ci631zzm890b2dzsrxxxrg15qpbac6jy-source
       > source root is source
       > rm: cannot remove 'package/dist/vendor': No such file or directory
       For full logs, run:
         nix log /nix/store/lq23pl8ycyf8myl9mynwzx9a2f2miywv-pnpm-10.34.0.drv
error: Cannot build '/nix/store/1hi18g4r0gmmlnj059irx91grry7ymv7-discourse-assets-2026.1.4.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/bw2pzh74fbp0wkn9f4b2bf2p6lwcva3d-discourse-assets-2026.1.4
         /nix/store/kqnrdh18f4pn87rpzk2af0d18xcvbj7k-discourse-assets-2026.1.4-generated
         /nix/store/mcbvqw0y8r3as9zrjmrq7pc32n64bj2r-discourse-assets-2026.1.4-frontend
         /nix/store/my9x48zhzzqi2w8rriww6qm4v9iaxxhx-discourse-assets-2026.1.4-node_modules
error: Cannot build '/nix/store/05ffysx25hfzw34km225d2krpnifwj75-discourse-2026.1.4.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/2b1pvnvln95dx7rxr88kc5b9g24x45dr-discourse-2026.1.4

```

Apparently the logs will just show the wrong build as if I didn’t overwrite it which is super helpful. It’s complaining about some `package/dist/vendor` file not being created.

yeah this is probably a thing best left to the maintainers

---

<div class="post-metadata">

### Author: ![ducks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ducks/32/518975_2.png) [@ducks](https://meta.discourse.org/u/ducks)
#### Post date: [August 20, 2026, 3:37am UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/13 "2026-08-20T03:37:36Z")

</div>

nixpkgs had a pretty outdated version of Discourse from January so I opened a PR to update it. I’ve never contributed to nixpkgs so we’ll see how it goes.

> <https://github.com/NixOS/nixpkgs/pull/554572>
>
> Backport of https://github.com/NixOS/nixpkgs/pull/548675 to \`release-26.05\`.
> 
> Th…is updates Discourse from the outdated \`2026.1.4\` ESR release to \`2026.7.1\`.
> 
> Changes: \[official Discourse changelog\](https://releases.discourse.org/changelog/custom?end=v2026.7.1&start=v2026.1.4)
> 
> The backport conflict in \`default.nix\` was resolved by retaining \`icu78\` from \`release-26.05\`. The release branch's \`nodejs-slim\_22.libv8\` links against ICU 78; using the generic \`icu\` package causes \`mini\_racer\_extension.so\` to fail with an undefined ICU symbol.
> 
> Automation disclosure: OpenAI Codex (GPT-5) assisted with the backport conflict resolution, testing, and drafting this pull request description.
> 
> \## Things done
> 
> 
> 
> \- Built on platform:
> - \[x\] x86\_64-linux
> - \[\] aarch64-linux
> - \[\] aarch64-darwin
> \- Tested, as applicable:
> - \[x\] \[NixOS tests\] in \[nixos/tests\].
> - \[x\] \[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.
> \- \[x\] Follows the \[automation/AI policy\].
> 
> \[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
> \[automation/AI policy\]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy
> \[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

---

<div class="post-metadata">

### Author: ![ducks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ducks/32/518975_2.png) [@ducks](https://meta.discourse.org/u/ducks)
#### Post date: [August 21, 2026, 10:52pm UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/14 "2026-08-21T22:52:51Z")

</div>

@fuguesoft looks like they merged in the updated Discourse nixpkg if you want to try that

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 20, 2026, 10:53pm UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/15 "2026-09-20T22:53:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
