nixos: added webcord overlay for wayland ime

This commit is contained in:
Aly Raffauf 2024-06-03 23:24:24 -04:00
parent aafdcada58
commit badf800960

View file

@ -1,6 +1,7 @@
inputs: { inputs: {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: {
imports = [ imports = [
@ -12,4 +13,32 @@ inputs: {
./system ./system
./user ./user
]; ];
nixpkgs.overlays = [
(final: prev: {
webcord = prev.webcord.overrideAttrs (old: {
installPhase = let
binPath = lib.makeBinPath [pkgs.xdg-utils];
in ''
runHook preInstall
# Remove dev deps that aren't necessary for running the app
npm prune --omit=dev
mkdir -p $out/lib/node_modules/webcord
cp -r app node_modules sources package.json $out/lib/node_modules/webcord/
install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png
# Add xdg-utils to path via suffix, per PR #181171
makeWrapper '${lib.getExe pkgs.electron}' $out/bin/webcord \
--suffix PATH : "${binPath}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}" \
--add-flags $out/lib/node_modules/webcord/
runHook postInstall
'';
});
})
];
} }