Skip to content

discord: fix krisp by using fhsEnv on linux#424232

Draft
samschlegel wants to merge 2 commits intoNixOS:masterfrom
samschlegel:samschlegel/use-fhsenv-for-discord-linux
Draft

discord: fix krisp by using fhsEnv on linux#424232
samschlegel wants to merge 2 commits intoNixOS:masterfrom
samschlegel:samschlegel/use-fhsenv-for-discord-linux

Conversation

@samschlegel
Copy link

@samschlegel samschlegel commented Jul 11, 2025

Fixes #195512

This fixes Krisp, which was broken since the binary was getting modified. By moving to using an fhsEnv instead of patchElf and not striping or modifying the binary in any way, the checksum passes.

Don't have a darwin machine to test this on ATM, and tbh don't even know if this is an issue there, so only made the change on the linux side

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

Fixes NixOS#195512

This fixes Krisp, by moving to using an fhsEnv and not striping or
modifying the binary in any way.

I make Cursor do this for me so I'll need to come back tomorrow and
actually see what cursed extra bullshit it added lol BUT IT WORKS!!!
# Execute Discord
exec ${discordDir}/${binaryName} \
--no-sandbox \
--disable-gpu-sandbox \
Copy link
Author

Choose a reason for hiding this comment

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

Yeah, this definitely seems non-ideal lol. Hopefully there's some other way around the zygote/GPU launch issues?

Copy link
Author

Choose a reason for hiding this comment

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

So this seems to be common between other electron apps, and the only other solution I've found seems to be not putting it in a sandbox, or using something like the Flathub version does with https://github.com/refi64/zypak to wrap Chromium in a way that it works in a nested sandbox. I don't see any specific usages of this tool in nixpkgs but perhaps there's another option.

At this point though this works well enough for my use cases so I won't personally be looking into other paths

Copy link
Member

Choose a reason for hiding this comment

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

Hey, I tried running the binary directly from your PR result/bin/Discord, removed those two flags and it seemed to run just fine? I'm not sure if they changed anything but your PR works for me. When was the application crashing for you?

Copy link
Author

Choose a reason for hiding this comment

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

I know there was an electron upgrade recently so perhaps that fixed things? I've actually moved back to a fedora base + home-manager so if you want to make that change then go for it

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! labels Jul 11, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 25, 2025
@nezia1 nezia1 mentioned this pull request Dec 2, 2025
13 tasks
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discord: krisp module doesn't load

2 participants