add custom equibop package with newer version and update flake.lock

This commit is contained in:
2026-11-20 16:39:07 +01:00
parent 02a68c3b09
commit c6d25a4819
8 changed files with 326 additions and 41 deletions
+8
View File
@@ -0,0 +1,8 @@
let
flake = builtins.getFlake (toString ./.);
pkgs = import flake.inputs.nixpkgs-new {
system = "aarch64-linux";
};
in
pkgs.callPackage ./pkgs/equibop/package.nix { }
Generated
+55 -38
View File
@@ -136,11 +136,11 @@
]
},
"locked": {
"lastModified": 1790898470,
"narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=",
"lastModified": 1793576659,
"narHash": "sha256-V1h85lUaJBQoHFrB2vpXZOE0Ju1MYSnIpsehoVZYlDo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "024633cd702b10285db5cb19b40ad48d2399ba60",
"rev": "ea2630b7470978622c7689a1ff75d2b389175399",
"type": "github"
},
"original": {
@@ -197,11 +197,11 @@
]
},
"locked": {
"lastModified": 1792896866,
"narHash": "sha256-/0tELNnhdSnP+bHSdWiEe6KpfSwi6WrTnT9cm/jNkjA=",
"lastModified": 1794963576,
"narHash": "sha256-+CPrP74GDJ63f7bgEFC9Av4hbxc7K9WUNv1ZVRifRe8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c216bf5a1f173b0481bd5c8c489ebe5595ecc68c",
"rev": "2b13c9cb3aa20653e6f8ee0b7f8331a53ea9b0a9",
"type": "github"
},
"original": {
@@ -218,11 +218,11 @@
]
},
"locked": {
"lastModified": 1792098797,
"narHash": "sha256-u4DIIZgznEGzByxXrxWCXK19VcMtTBmi/M9gZ7Jk9bM=",
"lastModified": 1794715309,
"narHash": "sha256-awkBBs5ctFKgEYjpNGpi3t/VqF589n5EWfdinRb2gNI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "640725978b99076e18e069f6e7d2959124584f8f",
"rev": "a1293da7dd8e497e08d26173f97e2976b36a31ea",
"type": "github"
},
"original": {
@@ -648,10 +648,26 @@
"type": "github"
}
},
"nixpkgs-new": {
"locked": {
"lastModified": 1794890597,
"narHash": "sha256-lME2lHoDHAaSHP3/okgiVoJ0icVEvsQH8LeU3We7tcc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "04906337b6d53e8bb0eaf0470ae9f070a4d4eb55",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-patch-xdg-desktop-portal": {
"flake": false,
"locked": {
"narHash": "sha256-9aKeHOkIAHkPU5jptkaJUD10qbP0rqhjkfsSdvFXN3g=",
"narHash": "sha256-mCEWbf74RhDE7+6yXDzQrLJb/g8WHdXslJGZdkm8S+I=",
"type": "file",
"url": "https://github.com/NixOS/nixpkgs/pull/548762.diff"
},
@@ -662,11 +678,11 @@
},
"nixpkgs-patcher": {
"locked": {
"lastModified": 1789143781,
"narHash": "sha256-WFr3wYdhSEJd/nQyJuETd6dcS08Exc+qoZWJ2tHM/gg=",
"lastModified": 1793529490,
"narHash": "sha256-AfocpOlYMgrEgE9j0OumoQGe1Uwke4k7vtzfffUl+tE=",
"owner": "gepbird",
"repo": "nixpkgs-patcher",
"rev": "da7c09e478f552c3a9ebb78b2f68426c1855fd81",
"rev": "e5f4b45fb4f0fc81dae025c173648cccbefca569",
"type": "github"
},
"original": {
@@ -693,11 +709,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1793110635,
"narHash": "sha256-dhoW6VgFWlaodSY5jrBn+CF2FLmaUvDVgM7+C7T2+NM=",
"lastModified": 1794890597,
"narHash": "sha256-lME2lHoDHAaSHP3/okgiVoJ0icVEvsQH8LeU3We7tcc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "31ecbaca1bdefa45dffc409f0250bd8039ea0010",
"rev": "04906337b6d53e8bb0eaf0470ae9f070a4d4eb55",
"type": "github"
},
"original": {
@@ -709,11 +725,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1791487292,
"narHash": "sha256-tqM7xDEsaeK1p6VvRygeZ9LkQRpUUkbRT02BHv6hnTM=",
"lastModified": 1793977579,
"narHash": "sha256-WrSODdZFVIs/Hh2NzC0bY+ROByi0bATg8WfePX8dPj8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8edc0c72e3a38faf5434e40d1f19431125fe4b30",
"rev": "4fe25e12eb9f4c744966dd3de5a05246cf098601",
"type": "github"
},
"original": {
@@ -741,11 +757,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1790689126,
"narHash": "sha256-ilerN1WLSvF+HMjziC/Wv99J5y02maDH+6hZPwsORKg=",
"lastModified": 1794386569,
"narHash": "sha256-x9sADJvoVG0L6RejZB+/BB4YiGZFBZrfTlhF4uBq1tQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b4fd65b198c599cbe814fcb9f42d25d021595ec9",
"rev": "d4f25a3e562008648d45bcf2d70bcc7422cad84e",
"type": "github"
},
"original": {
@@ -762,11 +778,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1792203519,
"narHash": "sha256-yJ072hxngo/srNdLTp4BlFeo0hedwnKicI3TGlSXLFE=",
"lastModified": 1794943345,
"narHash": "sha256-1d33ym1V/UxX9pcNbrpG0/P8riFHE8VuVAc3T8WN52I=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "453dc9c5037e6d1bec81d2a51ddacd58a2f44e9c",
"rev": "b67578f451bd779e79ec42f8153a403421a4b266",
"type": "github"
},
"original": {
@@ -807,6 +823,7 @@
"hyprsplit": "hyprsplit",
"nixpkgs": "nixpkgs_3",
"nixpkgs-anydesk": "nixpkgs-anydesk",
"nixpkgs-new": "nixpkgs-new",
"nixpkgs-patch-xdg-desktop-portal": "nixpkgs-patch-xdg-desktop-portal",
"nixpkgs-patcher": "nixpkgs-patcher",
"nixvim": "nixvim",
@@ -844,11 +861,11 @@
]
},
"locked": {
"lastModified": 1792809984,
"narHash": "sha256-KV+CaZX7QS0hcdKxwGKehDb1jmUgx6lbkTPpaoIW5Nw=",
"lastModified": 1794866654,
"narHash": "sha256-Y28AMB8lyKjASdJ0BVsR2AqR1cUsVuo8RVVpzHoECho=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "442449fa7b1fe6c692d0103ac9fc8f9e82931cf3",
"rev": "7c637afdccdf9bcf35c4a2d67b58a77c1fd843a4",
"type": "github"
},
"original": {
@@ -973,16 +990,16 @@
"xremap": {
"flake": false,
"locked": {
"lastModified": 1792336295,
"narHash": "sha256-a58EwgvAr5fQhe2wTaXhkEP3dMpQTxzD7aXlLn12zUc=",
"lastModified": 1794243668,
"narHash": "sha256-lETW8I19p7NjdPL5zte3B3skTw6vAiJ1oWx9lNlVFLs=",
"owner": "k0kubun",
"repo": "xremap",
"rev": "a9877f873f87f66adfc1b106f4ab18c7a2ff3bbb",
"rev": "23e880d441bf968de396c731fdcea18b1af62d9b",
"type": "github"
},
"original": {
"owner": "k0kubun",
"ref": "v0.15.15",
"ref": "v0.15.18",
"repo": "xremap",
"type": "github"
}
@@ -995,11 +1012,11 @@
"xremap": "xremap"
},
"locked": {
"lastModified": 1792460584,
"narHash": "sha256-eblfEmBfor5XKrwmz51MhMa+FOT7RgYznGTWpLcCXc8=",
"lastModified": 1794244210,
"narHash": "sha256-7nqo6Y3hc9J38O/7xzOTq+vnZnoVKVMf16TyDBq72wE=",
"owner": "xremap",
"repo": "nix-flake",
"rev": "d2925113fffcc55f3f621849c3fad8d80e532b22",
"rev": "0c48328034c0a6527a0e385555629b65c7db7a8b",
"type": "github"
},
"original": {
@@ -1014,11 +1031,11 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1792963762,
"narHash": "sha256-ThRNX0+T2Gb3ZD0Xf+/R3wJdL93/mW80ubMnLjZelTY=",
"lastModified": 1794982370,
"narHash": "sha256-ophGTkzf7oFD5Fa7Bjf2lVTf9XjKkMtv2fShaRkODPw=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "ed68d814d6cf2e221ba43d84f1e32429f5e2786f",
"rev": "2cc6b81e90ea910e6ddbbc0f4c665b4545060a75",
"type": "github"
},
"original": {
+2
View File
@@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-new.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -62,6 +63,7 @@
inherit (inputs)
sls-steam
bcdl-free
nixpkgs-new
;
};
nixpkgsPatcher.inputs = inputs;
+14 -1
View File
@@ -1,4 +1,10 @@
{ pkgs, ... }: {
{
pkgs,
system,
nixpkgs-new,
...
}:
{
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
@@ -80,6 +86,13 @@
ddcutil
iotop
yams
equibop
];
nixpkgs.overlays = [
(final: prev: {
equibop = nixpkgs-new.legacyPackages.${system}.callPackage ../../pkgs/equibop/package.nix { };
})
];
fonts.packages = with pkgs; [
+2 -2
View File
@@ -10,8 +10,8 @@
extraConfig.pipewire = {
"98-crackling-fix" = {
"context.properties" = {
"default.clock.quantum" = 2048;
"default.clock.min-quantum" = 256;
"default.clock.quantum" = 1024;
"default.clock.min-quantum" = 1024;
"default.clock.max-quantum" = 8192;
};
};
+3
View File
@@ -11,4 +11,7 @@
virtualisation.spiceUSBRedirection.enable = true;
boot.binfmt.emulatedSystems = [
"aarch64-linux"
];
}
+60
View File
@@ -0,0 +1,60 @@
# fixed output derrivation adapted from
# https://github.com/NixOS/nixpkgs/blob/28c3f83a9a77e3ada57afb71cc4052d2c435597a/pkgs/by-name/op/opencode/package.nix#L59-L122
{
lib,
stdenvNoCC,
equibop,
bun,
writableTmpDirAsHomeHook,
}:
stdenvNoCC.mkDerivation {
inherit (equibop) version src;
pname = equibop.pname + "-modules";
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
"GIT_PROXY_COMMAND"
"SOCKS_SERVER"
];
nativeBuildInputs = [
bun
writableTmpDirAsHomeHook
];
dontConfigure = true;
dontFixup = true;
buildPhase = ''
runHook preBuild
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
bun install \
--filter=equibop \
--force \
--frozen-lockfile \
--ignore-scripts \
--linker=hoisted \
--no-progress
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R ./node_modules $out
runHook postInstall
'';
outputHash =
{
x86_64-linux = "sha256-Gtsy22jI9y6a8NB/bRR4j1z1PwFlfJPzIPznr7fLb8M=";
aarch64-linux = "sha256-LCmlxa6SZwex33c0zjR+cIIp2HdyHNtpZHoAfFKaR+Y=";
}
.${stdenvNoCC.hostPlatform.system}
or (throw "Unsupported system ${stdenvNoCC.hostPlatform.system}");
outputHashAlgo = "sha256";
outputHashMode = "recursive";
}
+182
View File
@@ -0,0 +1,182 @@
{
lib,
stdenv,
callPackage,
fetchFromGitHub,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
electron_45,
python3Packages,
pipewire,
libpulseaudio,
jq,
autoPatchelfHook,
bun,
nodejs,
withTTS ? true,
withMiddleClickScroll ? false,
}:
let
electron = electron_45;
in
stdenv.mkDerivation (finalAttrs: {
pname = "equibop";
version = "3.3.4";
src = fetchFromGitHub {
owner = "Equicord";
repo = "Equibop";
tag = "v${finalAttrs.version}";
hash = "sha256-wsaVqBYETYFTsG78UInY5Z6VvUr8RLWMC8/eW8lTldY=";
};
postPatch = ''
substituteInPlace scripts/build/build.mts \
--replace-fail 'gitHash = execSync("git rev-parse HEAD", { encoding: "utf-8" }).trim();' 'gitHash = "${finalAttrs.src.hash}"'
# disable auto updates
substituteInPlace src/main/updater.ts \
--replace-fail 'const isOutdated = autoUpdater.checkForUpdates().then(res => Boolean(res?.isUpdateAvailable));' 'const isOutdated = false;'
'';
node-modules = callPackage ./node-modules.nix { equibop = finalAttrs.finalPackage; }; # helps when the parent package is overidden
nativeBuildInputs = [
bun
jq
nodejs
# XXX: Equibop *does not* ship venmic as a prebuilt node module. The package
# seems to build with or without this hook, but I (NotAShelf) don't have the
# time to test the consequences of removing this hook. Please open a pull
# request if this bothers you in some way.
autoPatchelfHook
copyDesktopItems
# we use a script wrapper here for environment variable expansion at runtime
# https://github.com/NixOS/nixpkgs/issues/172583
makeWrapper
];
buildInputs = [
libpulseaudio
pipewire
(lib.getLib stdenv.cc.cc)
];
configurePhase = ''
runHook preConfigure
cp -R ${finalAttrs.node-modules} node_modules
runHook postConfigure
'';
preBuild = ''
# Validate electron version matches upstream package.json
if [ "`jq -r '.devDependencies.electron' < package.json | cut -d. -f1 | tr -d '^'`" != "${lib.versions.major electron.version}" ]
then
echo "ERROR: electron version mismatch between package.json and nixpkgs"
exit 1
fi
# electron builds must be writable to support electron fuses
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
'';
buildPhase = ''
runHook preBuild
bun run build
# can't run it via bunx / npx since fixupPhase was skipped for node_modules
node node_modules/electron-builder/out/cli/cli.js \
--dir \
-c.electronDist=electron-dist \
-c.electronVersion=${electron.version} \
-c.npmRebuild=false
runHook postBuild
'';
postBuild = ''
pushd build
${lib.getExe' python3Packages.icnsutil "icnsutil"} e icon.icns
popd
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt/Equibop
cp -r dist/*unpacked/resources $out/opt/Equibop/
for file in build/icon.icns.export/*.png; do
base=''${file##*/}
size=''${base/x*/}
install -Dm0644 $file $out/share/icons/hicolor/''${size}x''${size}/apps/equibop.png
done
install -Dm0644 build/icon.svg $out/share/icons/hicolor/scalable/apps/equibop.svg
runHook postInstall
'';
postFixup = ''
# NOTE: LD_LIBRARY_PATH is needed, because equibop raises a warning at the start
# and it fixes a couple of bugs
makeWrapper ${electron}/bin/electron $out/bin/equibop \
--add-flags $out/opt/Equibop/resources/app.asar \
${lib.optionalString withTTS ''
--run 'if [[ "''${NIXOS_SPEECH:-default}" != "False" ]]; then NIXOS_SPEECH=True; else unset NIXOS_SPEECH; fi' \
--add-flags "\''${NIXOS_SPEECH:+--enable-speech-dispatcher}" \
''} \
${lib.optionalString withMiddleClickScroll "--add-flags \"--enable-blink-features=MiddleClickAutoscroll\""} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ (lib.getLib stdenv.cc.cc) ]}"
'';
desktopItems = makeDesktopItem {
name = "equibop";
desktopName = "Equibop";
exec = "equibop %U";
icon = "equibop";
startupWMClass = "Equibop";
genericName = "Internet Messenger";
keywords = [
"discord"
"equibop"
"electron"
"chat"
];
categories = [
"Network"
"InstantMessaging"
"Chat"
];
};
passthru = {
# fails to update node-modules FOD :/
# updateScript = nix-update-script {
# extraArgs = [
# "--subpackage"
# "node-modules"
# ];
# };
};
meta = {
description = "Custom Discord App aiming to give you better performance and improve linux support";
homepage = "https://github.com/Equicord/Equibop";
changelog = "https://github.com/Equicord/Equibop/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
NotAShelf
rexies
PerchunPak
];
mainProgram = "equibop";
# I am not confident in my ability to support Darwin, please PR if this is important to you
platforms = lib.platforms.linux;
};
})