From 16ca6c79eb78b0cad87822c907cee601c3571664 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 24 Jun 2023 14:18:46 +0200 Subject: [PATCH 1/3] vencord: disable updater Signed-off-by: Sefa Eyeoglu --- pkgs/misc/vencord/default.nix | 1 + pkgs/misc/vencord/disable-updater-ui.patch | 35 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/misc/vencord/disable-updater-ui.patch diff --git a/pkgs/misc/vencord/default.nix b/pkgs/misc/vencord/default.nix index b31c03699bd6..f06b9af56936 100644 --- a/pkgs/misc/vencord/default.nix +++ b/pkgs/misc/vencord/default.nix @@ -46,6 +46,7 @@ buildNpmPackage rec { src = ./replace-git.patch; inherit version; }) + ./disable-updater-ui.patch ]; installPhase = if buildWebExtension then '' diff --git a/pkgs/misc/vencord/disable-updater-ui.patch b/pkgs/misc/vencord/disable-updater-ui.patch new file mode 100644 index 000000000000..6682d814b862 --- /dev/null +++ b/pkgs/misc/vencord/disable-updater-ui.patch @@ -0,0 +1,35 @@ +diff --git a/src/components/VencordSettings/UpdaterTab.tsx b/src/components/VencordSettings/UpdaterTab.tsx +index 4d0b86c..0f1d87f 100644 +--- a/src/components/VencordSettings/UpdaterTab.tsx ++++ b/src/components/VencordSettings/UpdaterTab.tsx +@@ -249,4 +249,4 @@ function Updater() { + ); + } + +-export default IS_WEB ? null : wrapTab(Updater, "Updater"); ++export default null; +diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx +index 3ea5a43..da63213 100644 +--- a/src/plugins/_core/settings.tsx ++++ b/src/plugins/_core/settings.tsx +@@ -105,7 +105,7 @@ export default definePlugin({ + label: "Themes", + element: require("@components/VencordSettings/ThemesTab").default, + }, +- !IS_WEB && { ++ false && !IS_WEB && { + section: "VencordUpdater", + label: "Updater", + element: require("@components/VencordSettings/UpdaterTab").default, +diff --git a/src/utils/updater.ts b/src/utils/updater.ts +index 2e2bfe1..5ebd06e 100644 +--- a/src/utils/updater.ts ++++ b/src/utils/updater.ts +@@ -38,6 +38,7 @@ async function Unwrap(p: Promise>) { + } + + export async function checkForUpdates() { ++ return false; + changes = await Unwrap(VencordNative.updater.getUpdates()); + if (changes.some(c => c.hash === gitHash)) { + isNewer = true; From de1624865fb4d14df27ffd6029891136c7a43f8d Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 24 Jun 2023 14:10:45 +0200 Subject: [PATCH 2/3] vencord: fix version number patch Signed-off-by: Sefa Eyeoglu --- pkgs/misc/vencord/replace-git.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/vencord/replace-git.patch b/pkgs/misc/vencord/replace-git.patch index ca377c642f25..829321638bf2 100644 --- a/pkgs/misc/vencord/replace-git.patch +++ b/pkgs/misc/vencord/replace-git.patch @@ -7,7 +7,7 @@ index 7ff599a..85b3bfa 100644 export const watch = process.argv.includes("--watch"); export const isStandalone = JSON.stringify(process.argv.includes("--standalone")); -export const gitHash = execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim(); -+export const gitHash = "@version@"; ++export const gitHash = "v@version@"; export const banner = { js: ` // Vencord ${gitHash} From 1410783ff5df4169b2a1fe468905e6c9488c688a Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 24 Jun 2023 13:49:56 +0200 Subject: [PATCH 3/3] vencord: set standalone build mode This tells Vencord that it is not installed using its Git installation method. Currently this doesn't do anything, as the only consumer of this value is the updater code, that has been effectively disabled using a patch. Signed-off-by: Sefa Eyeoglu --- pkgs/misc/vencord/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/misc/vencord/default.nix b/pkgs/misc/vencord/default.nix index f06b9af56936..38dbc1fa8f81 100644 --- a/pkgs/misc/vencord/default.nix +++ b/pkgs/misc/vencord/default.nix @@ -36,6 +36,7 @@ buildNpmPackage rec { npmDepsHash = "sha256-m+hczXog03Gz81CP/blkRJPaTrEhmLQFvVtOfWKYQL4="; npmFlags = [ "--legacy-peer-deps" ]; npmBuildScript = if buildWebExtension then "buildWeb" else "build"; + npmBuildFlags = [ "--" "--standalone" ]; prePatch = '' cp ${./package-lock.json} ./package-lock.json @@ -49,11 +50,12 @@ buildNpmPackage rec { ./disable-updater-ui.patch ]; - installPhase = if buildWebExtension then '' - cp -r dist/chromium-unpacked/ $out - '' else '' - cp -r dist/ $out - ''; + installPhase = + if buildWebExtension then '' + cp -r dist/chromium-unpacked/ $out + '' else '' + cp -r dist/ $out + ''; meta = with lib; { description = "Vencord web extension";