Skip to content

Commit de24c24

Browse files
goofcord: 1.7.1 -> 2.2.0 (#487177)
2 parents 4046854 + 26b6641 commit de24c24

4 files changed

Lines changed: 204 additions & 32 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# fixed output derivation for node_modules
2+
{
3+
lib,
4+
stdenv,
5+
goofcord,
6+
bun,
7+
nodejs,
8+
writableTmpDirAsHomeHook,
9+
}:
10+
stdenv.mkDerivation {
11+
inherit (goofcord) version src;
12+
pname = goofcord.pname + "-modules";
13+
14+
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
15+
"GIT_PROXY_COMMAND"
16+
"SOCKS_SERVER"
17+
];
18+
19+
nativeBuildInputs = [
20+
bun
21+
nodejs
22+
writableTmpDirAsHomeHook
23+
];
24+
25+
dontConfigure = true;
26+
dontFixup = true;
27+
28+
buildPhase = ''
29+
runHook preBuild
30+
31+
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
32+
export npm_config_build_from_source=true
33+
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
34+
35+
bun install \
36+
--frozen-lockfile \
37+
--linker=hoisted \
38+
--no-progress
39+
40+
runHook postBuild
41+
'';
42+
43+
installPhase = ''
44+
runHook preInstall
45+
46+
cp -R ./node_modules $out
47+
48+
runHook postInstall
49+
'';
50+
51+
outputHash =
52+
{
53+
x86_64-linux = "sha256-EEl+hrdMR6z1PAy+uIhl2UYtajXWiUQMQxIfYpMRw6Y=";
54+
aarch64-linux = "sha256-ba+j8FGKNH3Mpql7xvLgHHuJxDGVlZ+TeZ3Oxsw3ot4=";
55+
}
56+
.${stdenv.hostPlatform.system} or (throw "Unsupported system ${stdenv.hostPlatform.system}");
57+
outputHashAlgo = "sha256";
58+
outputHashMode = "recursive";
59+
60+
meta = {
61+
description = "Node modules for GoofCord";
62+
license = lib.licenses.osl3;
63+
platforms = lib.platforms.linux;
64+
};
65+
}

pkgs/by-name/go/goofcord/package.nix

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,84 @@
11
{
22
lib,
33
stdenv,
4+
callPackage,
45
fetchFromGitHub,
5-
pnpm_9,
6-
fetchPnpmDeps,
7-
pnpmConfigHook,
8-
nodejs_22,
9-
nix-update-script,
6+
bun,
7+
nodejs_24,
108
electron,
11-
pipewire,
12-
libpulseaudio,
9+
nix-update-script,
10+
libxkbcommon,
11+
libx11,
12+
libxcb,
13+
libxtst,
1314
makeShellWrapper,
1415
makeDesktopItem,
1516
copyDesktopItems,
1617
}:
17-
1818
let
19-
pnpm = pnpm_9.override { nodejs = nodejs_22; };
19+
patchcordAddon = callPackage ./patchcord-addon.nix { };
20+
venbindAddon = callPackage ./venbind-addon.nix { };
2021
in
2122
stdenv.mkDerivation (finalAttrs: {
2223
pname = "goofcord";
23-
version = "1.7.1";
24+
version = "2.2.0";
2425

2526
src = fetchFromGitHub {
2627
owner = "Milkshiift";
2728
repo = "GoofCord";
28-
rev = "v${finalAttrs.version}";
29-
hash = "sha256-fx/RKnUhXhaWVd/KYPVxr19/Q8o1ovm2TgMTcTYjE3Q=";
29+
tag = "v${finalAttrs.version}";
30+
hash = "sha256-BnaPw9edaI1nKAu421JBkI9dAV3Xu3Yr5VQILN0QUTM=";
3031
};
3132

3233
nativeBuildInputs = [
33-
pnpmConfigHook
34-
pnpm
35-
nodejs_22
34+
bun
35+
nodejs_24
3636
makeShellWrapper
3737
copyDesktopItems
3838
];
3939

4040
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
41-
libpulseaudio
42-
pipewire
41+
libxkbcommon
42+
libx11
43+
libxcb
44+
libxtst
4345
(lib.getLib stdenv.cc.cc)
4446
];
4547

46-
pnpmDeps = fetchPnpmDeps {
47-
inherit (finalAttrs) pname version src;
48-
inherit pnpm;
49-
fetcherVersion = 3;
50-
hash = "sha256-NKind57XDW7I5XNmjAu4cqkK5UVNAaKewpfOTNzF2BM=";
51-
};
48+
node-modules = callPackage ./node-modules.nix { nodejs = nodejs_24; };
5249

5350
env = {
5451
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
52+
GOOFCORD_PATCHCORD_PATH = "${patchcordAddon}/bin/patchcord";
53+
GOOFCORD_VENBIND_PATH = "${venbindAddon}/lib/libvenbind.so";
5554
};
5655

56+
configurePhase = ''
57+
runHook preConfigure
58+
59+
cp -R ${finalAttrs.node-modules} node_modules
60+
chmod -R u+w node_modules
61+
patchShebangs node_modules/.bin
62+
patchShebangs node_modules/@typescript/native-preview/bin
63+
64+
runHook postConfigure
65+
'';
66+
67+
preBuild = lib.optionalString stdenv.hostPlatform.isLinux ''
68+
cp -r ${electron.dist} electron-dist
69+
chmod -R u+w electron-dist
70+
'';
71+
5772
buildPhase = ''
5873
runHook preBuild
5974
60-
pnpm build
75+
bun run build -- --skipTypecheck
6176
62-
npm exec electron-builder -- \
77+
node node_modules/electron-builder/out/cli/cli.js \
6378
--dir \
64-
-c.electronDist="${electron.dist}" \
65-
-c.electronVersion="${electron.version}"
79+
-c.electronDist="${if stdenv.hostPlatform.isLinux then "electron-dist" else electron.dist}" \
80+
-c.electronVersion="${electron.version}" \
81+
-c.npmRebuild=false
6682
6783
runHook postBuild
6884
'';
@@ -73,13 +89,21 @@ stdenv.mkDerivation (finalAttrs: {
7389
mkdir -p "$out/share/lib/goofcord"
7490
cp -r ./dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/goofcord"
7591
76-
install -Dm644 "build/icon.png" "$out/share/icons/hicolor/256x256/apps/goofcord.png"
92+
install -Dm644 "assets/gf_icon.png" "$out/share/icons/hicolor/256x256/apps/goofcord.png"
7793
7894
# use makeShellWrapper (instead of the makeBinaryWrapper provided by wrapGAppsHook3) for proper shell variable expansion
7995
# see https://github.com/NixOS/nixpkgs/issues/172583
8096
makeShellWrapper "${lib.getExe electron}" "$out/bin/goofcord" \
8197
--add-flags "$out/share/lib/goofcord/resources/app.asar" \
8298
"''${gappsWrapperArgs[@]}" \
99+
--prefix LD_LIBRARY_PATH : "${
100+
lib.makeLibraryPath [
101+
libxkbcommon
102+
libx11
103+
libxcb
104+
libxtst
105+
]
106+
}" \
83107
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" \
84108
--set-default ELECTRON_IS_DEV 0 \
85109
--inherit-argv0
@@ -120,11 +144,11 @@ stdenv.mkDerivation (finalAttrs: {
120144
homepage = "https://github.com/Milkshiift/GoofCord";
121145
downloadPage = "https://github.com/Milkshiift/GoofCord";
122146
license = lib.licenses.osl3;
123-
maintainers = with lib.maintainers; [ nyabinary ];
124-
platforms = [
125-
"x86_64-linux"
126-
"aarch64-linux"
147+
maintainers = with lib.maintainers; [
148+
nyabinary
149+
miniharinn
127150
];
151+
platforms = lib.platforms.linux;
128152
mainProgram = "goofcord";
129153
};
130154
})
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
fetchFromGitHub,
5+
}:
6+
rustPlatform.buildRustPackage {
7+
pname = "patchcord";
8+
version = "0-unstable-2026-03-29";
9+
10+
src = fetchFromGitHub {
11+
owner = "Milkshiift";
12+
repo = "patchcord";
13+
rev = "f2611630f143a53b46514d4916af0971d7aab2b5";
14+
hash = "sha256-VTHS5psVqg4RjSrAs9vPkixsVwwIYE2E4o0vXVN58tE=";
15+
};
16+
17+
cargoHash = "sha256-/IbHvs9SEuulNcWkihwFwaFcqMM0rdFBVjCWgUu7dys=";
18+
19+
doCheck = false;
20+
21+
meta = {
22+
description = "Patcher for GoofCord";
23+
homepage = "https://github.com/Milkshiift/patchcord";
24+
license = lib.licenses.osl3;
25+
platforms = lib.platforms.linux;
26+
};
27+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
lib,
3+
stdenv,
4+
rustPlatform,
5+
fetchFromGitHub,
6+
cmake,
7+
pkg-config,
8+
libx11,
9+
libxtst,
10+
libxdmcp,
11+
libxkbfile,
12+
libxkbcommon,
13+
libxcb,
14+
wayland,
15+
xorgproto,
16+
}:
17+
rustPlatform.buildRustPackage (finalAttrs: {
18+
pname = "venbind";
19+
version = "0.1.7";
20+
21+
src = fetchFromGitHub {
22+
owner = "tuxinal";
23+
repo = "venbind";
24+
tag = "v${finalAttrs.version}";
25+
hash = "sha256-6gPyQ6JjqvM2AUuIxCfO0nOLJfyQTX5bbsbKDzlNSqo=";
26+
fetchSubmodules = true;
27+
};
28+
29+
cargoHash = "sha256-FZTXj8f+ezRhElovKhF3khWc5SqC+22tDHlFe9IHuwo=";
30+
31+
nativeBuildInputs = [
32+
rustPlatform.bindgenHook
33+
pkg-config
34+
cmake
35+
];
36+
37+
buildInputs = [
38+
libx11
39+
libxtst
40+
libxdmcp
41+
libxkbfile
42+
libxkbcommon
43+
libxcb
44+
wayland
45+
xorgproto
46+
];
47+
48+
doCheck = false;
49+
50+
meta = {
51+
description = "Native module for Vencord";
52+
homepage = "https://github.com/tuxinal/venbind";
53+
license = lib.licenses.gpl3Only;
54+
platforms = lib.platforms.linux;
55+
};
56+
})

0 commit comments

Comments
 (0)