Repository navigation
Description
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
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
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
- I assert that I have read the automation/AI policy and that this issue report complies with it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Activity
pacien commentedon Jun 4, 2026
RossBrunton commentedon Jun 4, 2026
On 25.11, looking at the systemd file, the
WorkingDirectoryseems to be/nix/store/pzv89pp5z8nznbz2k05lhk11l4wnclfc-matrix-appservice-discord-4.0.0/libexec/matrix-appservice-discord/deps/matrix-appservice-discordwhich contains the following files: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).
RossBrunton commentedon Jun 5, 2026
For 26.05:
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:
So it looks like
binis sufficient for the path.pacien commentedon Jun 5, 2026
nixos/services.matrix-appservice-discord: Don't set WorkingDirectory
RossBrunton commentedon Jun 5, 2026
Yep, looks a WorkingDirectory isn't needed (at least in my system). I've opened up a PR to remove it.
nixos/matrix-appservice-discord: Don't set WorkingDirectory
pacien commentedon Jul 10, 2026
This issue still applies to 26.05.
Not sure why it was closed by PR #529299 (which applies to unstable).
Reopening.