mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:36 +01:00
Switch to the native deb package from nixpkgs-patched (#560225), remove the AppImage/FHS bwrap layer, and enable native Wayland while keeping the X11 fallback. Keep only WeChat state under one app-scoped HOME and bind the host Documents and Downloads directories like the other desktop apps. User-selected files also go through the XDG FileChooser portal. Remove the launcher, activation script, and compatibility symlinks. Assisted-by: DeepSeek Harness (deepseek-flash)
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
# WeChat data and its sandbox boundary are owned by nixpak.
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
sloth,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
./desktop-base.nix
|
|
./network.nix
|
|
];
|
|
pasta.mode = "isolate";
|
|
desktopIntegration.tray = true;
|
|
portalGroups = {
|
|
fileChooser = true;
|
|
openUri = true;
|
|
notifications = true;
|
|
screenCast = true;
|
|
camera = true;
|
|
inputMethod = true;
|
|
};
|
|
bubblewrap = {
|
|
sockets.x11 = true;
|
|
# libdbus aborts without /etc/machine-id; use a synthetic app-scoped value.
|
|
bind.ro = [
|
|
[
|
|
(toString (
|
|
pkgs.writeText "wechat-machine-id" "${
|
|
builtins.substring 0 32 (builtins.hashString "sha256" config.flatpak.appId)
|
|
}\n"
|
|
))
|
|
"/etc/machine-id"
|
|
]
|
|
];
|
|
bind.rw = [
|
|
sloth.xdgDocumentsDir
|
|
sloth.xdgDownloadDir
|
|
];
|
|
env = {
|
|
# WeChat keeps .xwechat and xwechat_files under HOME. User-selected
|
|
# files also go through the XDG file chooser portal where available.
|
|
HOME = lib.mkForce (sloth.concat' sloth.xdgDataHome "/wechat");
|
|
DISPLAY = sloth.envOr "DISPLAY" "";
|
|
XAUTHORITY = sloth.envOr "XAUTHORITY" (sloth.concat' sloth.homeDir "/.Xauthority");
|
|
XDG_DOCUMENTS_DIR = sloth.xdgDocumentsDir;
|
|
XDG_DOWNLOAD_DIR = sloth.xdgDownloadDir;
|
|
PATH = lib.makeBinPath [ pkgs.coreutils ];
|
|
};
|
|
};
|
|
}
|