From 7a5380f41949a2e3272eff7c3f1457e4e45935a5 Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 14 Nov 2024 18:16:49 +0100 Subject: [PATCH] admin-fe: disable unused features --- config/services/akkoma/default.nix | 2 +- pkgs/akkoma-admin-fe/default.nix | 7 ++++++ pkgs/akkoma-admin-fe/disable-options.patch | 25 ++++++++++++++++++++++ pkgs/overlay.nix | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 pkgs/akkoma-admin-fe/default.nix create mode 100644 pkgs/akkoma-admin-fe/disable-options.patch diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index 9901e50..25989dd 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -49,7 +49,7 @@ ref = "5f0339ce00"; }; admin = { - package = pkgs.akkoma-frontends.admin-fe; + package = pkgs.akkoma-admin-fe; name = "admin-fe"; ref = "stable"; }; diff --git a/pkgs/akkoma-admin-fe/default.nix b/pkgs/akkoma-admin-fe/default.nix new file mode 100644 index 0000000..e4fa685 --- /dev/null +++ b/pkgs/akkoma-admin-fe/default.nix @@ -0,0 +1,7 @@ +{ + akkoma-frontends +}: + +akkoma-frontends.admin-fe.overrideAttrs { + patches = [ ./disable-options.patch ]; +} diff --git a/pkgs/akkoma-admin-fe/disable-options.patch b/pkgs/akkoma-admin-fe/disable-options.patch new file mode 100644 index 0000000..4954a10 --- /dev/null +++ b/pkgs/akkoma-admin-fe/disable-options.patch @@ -0,0 +1,25 @@ +diff --git a/config/index.js b/config/index.js +index 4bc47744..ceb1bbd5 100644 +--- a/config/index.js ++++ b/config/index.js +@@ -18,7 +18,7 @@ module.exports = { + host: 'localhost', + port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: true, +- errorOverlay: true, ++ errorOverlay: false, + notifyOnErrors: false, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + +diff --git a/config/prod.env.js b/config/prod.env.js +index 7acb93a2..ea500e99 100644 +--- a/config/prod.env.js ++++ b/config/prod.env.js +@@ -2,6 +2,6 @@ module.exports = { + NODE_ENV: '"production"', + ENV_CONFIG: '"prod"', + BASE_API: '"https://api-prod"', +- DISABLED_FEATURES: '[""]', ++ DISABLED_FEATURES: '["settings","media-proxy-cache","relays"]', + ASSETS_PUBLIC_PATH: '/pleroma/admin/' + } diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 8934f1c..5a40d24 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -6,6 +6,7 @@ final: prev: { librespeed-rust = final.callPackage ./librespeed-rust/default.nix {}; librespeed-go = final.callPackage ./librespeed-go/default.nix {}; akkoma-fe-domi = final.callPackage ./akkoma-fe-domi/default.nix {}; + akkoma-admin-fe = final.callPackage ./akkoma-admin-fe/default.nix {}; nginxQuic = prev.nginxQuic.override { withSlice = true; # Use zlib because zlib-ng uses larger buffers then nginx preallocates.