Skip to content

nixos/matrix-appservice-discord: nodeAppDir missing error after update to 26.05 #527654

Description

@RossBrunton

Nixpkgs version

  • Stable (26.05)

Describe the bug

After updating my system to NixOS 26.05 and rebuilding, I started to receive this error:

error:
       … while calling the 'head' builtin
         at «github:NixOS/nixpkgs/b51242d7d43689db2f3be91bd05d5b24fbb469c4?narHash=sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1%2BN6cArVE%3D»/lib/attrsets.nix:1712:13:
         1711|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1712|             head values
             |             ^
         1713|           else

       … while evaluating the attribute 'value'
         at «github:NixOS/nixpkgs/b51242d7d43689db2f3be91bd05d5b24fbb469c4?narHash=sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1%2BN6cArVE%3D»/lib/modules.nix:1167:7:
         1166|     // {
         1167|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1168|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/i936ws2xplkqgbzkxkacqqq2dpag3ndf-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `warnings':

       … while evaluating definitions from `/nix/store/i936ws2xplkqgbzkxkacqqq2dpag3ndf-source/nixos/modules/system/boot/systemd.nix':

       … while evaluating the option `systemd.services.matrix-appservice-discord.serviceConfig':

       … while evaluating definitions from `/nix/store/i936ws2xplkqgbzkxkacqqq2dpag3ndf-source/nixos/modules/services/matrix/appservice-discord.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'nodeAppDir' missing
       at «github:NixOS/nixpkgs/b51242d7d43689db2f3be91bd05d5b24fbb469c4?narHash=sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1%2BN6cArVE%3D»/nixos/modules/services/matrix/appservice-discord.nix:1
47:46:
          146|         PrivateTmp = true;
          147|         WorkingDirectory = "${cfg.package}/${cfg.package.passthru.nodeAppDir}";
             |                                              ^
          148|         StateDirectory = baseNameOf dataDir;

The error pointing to this line here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/matrix/appservice-discord.nix#L147

Having a look through the history of the package, it looks like this could have been caused by #493048 given that the package structure has changed, but I don't know enough about the NodeJS internals to debug further.

Steps to reproduce

The relevant module in my configuration is this:

{ config, pkgs, ... }: rec {
  age.secrets.discord_bridge = {
    (redacted)
  };

  services.matrix-synapse.settings.app_service_config_files = [
    "/var/lib/matrix-synapse/discord-registration.yaml"
  ];

  nixpkgs.config.permittedInsecurePackages = [
    "nodejs-20.20.2"
    "nodejs-slim-20.20.2"
    "nodejs-20.20.2-source"
  ];

  services.matrix-appservice-discord = {
    enable = true;
    #package = pkgs.matrix-appservice-discord;
    environmentFile = config.age.secrets.discord_bridge.path;
    port = 9105;
    settings = {
      bridge = {
        domain = (redacted);
        homeserverUrl = (redacted);
        enableSelfServiceBridging = true;
        disablePresence = true;
      };
      auth = { usePrivilegedIntents = true; };
      ghosts.usernamePattern = ":username";
    };
  };
}

Expected behaviour

System rebuild completes and the Discord bridge is operational.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.82, NixOS, 25.11 (Xantusia), 25.11.20260429.755f5aa
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.31.4
  • channels(root): "agenix, nixos-23.11"
  • nixpkgs: /nix/store/ds6zw8983xm46y10dq7aswqkgmry968q-source

Notify maintainers

@pacien


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    6.topic: nixos
    on Jun 3, 2026
  2. pacien commented on Jun 4, 2026

    @pacien
    Contributor
  3. RossBrunton commented on Jun 4, 2026

    @RossBrunton
    Author

    On 25.11, looking at the systemd file, the WorkingDirectory seems to be /nix/store/pzv89pp5z8nznbz2k05lhk11l4wnclfc-matrix-appservice-discord-4.0.0/libexec/matrix-appservice-discord/deps/matrix-appservice-discord which contains the following files:

    build        CHANGELOG.md  CONTRIBUTING.md  docs     logfile.log.2026-04-02     node_modules  pyproject.toml  screenshot.png  src   tools          yarn.lock
    changelog.d  config        Dockerfile       LICENSE  matrix-appservice-discord  package.json  README.md       scripts         test  tsconfig.json
    

    I'll post the build for 26.05 when I can get it to build (it seems to need to build NodeJS 20 from scratch first, which my poor server can't handle).

  4. RossBrunton commented on Jun 5, 2026

    @RossBrunton
    Author

    For 26.05:

    $ nix run nixpkgs#tree -- /nix/store/dagrnillkj5qwh0hc9ixcl47vf4c8gws-matrix-appservice-discord-4.0.0/ -L 4
    /nix/store/dagrnillkj5qwh0hc9ixcl47vf4c8gws-matrix-appservice-discord-4.0.0/
    ├── bin
    │   ├── matrix-appservice-discord
    │   ├── matrix-appservice-discord-addbot
    │   ├── matrix-appservice-discord-addRoomsToDirectory
    │   ├── matrix-appservice-discord-adminme
    │   ├── matrix-appservice-discord-chanfix
    │   ├── matrix-appservice-discord-ghostfix
    │   ├── matrix-appservice-discord-toolshelper
    │   └── matrix-appservice-discord-userClientTools
    └── lib
        └── node_modules
            └── matrix-appservice-discord
                ├── node_modules
                ├── src
                ├── test
                └── tools
    
    9 directories, 8 files
    

    A quick glance doesn't reveal any comparable directory.

    However, the following does seem to work and produce (as far as I can tell) a functioning bridge:

        package = pkgs.matrix-appservice-discord.overrideAttrs(old: {
          passthru.nodeAppDir = "bin";
        });

    So it looks like bin is sufficient for the path.

  5. pacien commented on Jun 5, 2026

    @pacien
    Contributor
  6. added a commit that references this issue on Jun 5, 2026
    ce74313
  7. RossBrunton commented on Jun 5, 2026

    @RossBrunton
    Author

    Yep, looks a WorkingDirectory isn't needed (at least in my system). I've opened up a PR to remove it.

  8. added a commit that references this issue on Jun 6, 2026
    11b0ae2
  9. pacien commented on Jul 10, 2026

    @pacien
    Contributor

    This issue still applies to 26.05.
    Not sure why it was closed by PR #529299 (which applies to unstable).
    Reopening.

  10. reopened this on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: nixos

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions