imnyang/nix-flakes
Watch
1
0
Fork
You've already forked nix-flakes
0
nix-flakes/modules/home/discord/linux.nix
2026-10-04 12:59:42 +09:00

66 lines
2.1 KiB
Nix

{
pkgs,
inputs,
...
}:
let
nixcordPackages = inputs.nixcord.packages.${pkgs.stdenv.hostPlatform.system};
patchGifenc = ''
substituteInPlace package.json \
--replace-fail \
'github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3' \
'1.0.3'
substituteInPlace pnpm-lock.yaml \
--replace-fail \
'github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3' \
'1.0.3' \
--replace-fail \
'https://codeload.github.com/mattdesl/gifenc/tar.gz/64842fca317b112a8590f8fef2bf3825da8f6fe3' \
'1.0.3' \
--replace-fail \
'resolution: {gitHosted: true, tarball: 1.0.3}' \
'resolution: {integrity: sha512-xdr6AdrfGBcfzncONUOlXMBuc5wJDtOueE3c5rdG0oNgtINLD+f2iFZltrBRZYzACRbKr+mSVU/x98zv2u3jmw==}'
'';
refreshPnpmDeps = package: hash:
package.overrideAttrs (old: {
postPatch = (old.postPatch or "") + patchGifenc;
pnpmDeps = old.pnpmDeps.overrideAttrs (deps: {
outputHash = hash;
outputHashAlgo = "sha256";
postPatch = (deps.postPatch or "") + patchGifenc;
});
});
in
{
imports = [ inputs.nixcord.homeModules.nixcord ];
programs.nixcord = {
enable = true;
# Use Nixcord's pinned package set; the host package set's pnpm hook
# cannot consume the Equicord Git tarball snapshot offline.
useGlobalPkgs = false;
discord = {
vencord.package = refreshPnpmDeps nixcordPackages.vencord "sha256-Me4M6ATfnTMifltjeCl/zn/qUrBUwOJuWkrCPw4VU5Q=";
equicord.package = refreshPnpmDeps nixcordPackages.equicord "sha256-wXQg11c6EUT0xFlP1pYwMNzdVKdg5Gv3gcdolDrnGCk=";
branches = [ "stable" ];
# Electron's Vulkan backend crashes on the NVIDIA render node under
# native Wayland. Keep Wayland and hardware acceleration, but use GL.
commandLineArgs = [
"--use-gl=angle"
"--use-angle=gl"
];
vencord.enable = false;
equicord.enable = true;
krisp.enable = true;
};
vesktop.enable = true;
# equibop.enable = true;
config.plugins = import ./plugin.nix;
};
home.packages = with pkgs; [
discord-gamesdk
];
}