Files
whc-nixos/modules/apps.nix
T
WHC 12e5ec30af Add KiCad, SPlayer, and fixed official OpenCode binary.
Replace broken nixpkgs opencode with upstream linux-x64 release to avoid SystemPrompt.environment crashes.
2026-09-19 18:59:14 +08:00

155 lines
3.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{ pkgs, ... }:
let
# nixpkgs 里的 QQ 官方链接已 404,改用 GitHub 镜像
qq-fixed = pkgs.qq.overrideAttrs (old: {
version = "3.2.28-2026-04-29";
src = pkgs.fetchurl {
url = "https://github.com/libzonda/Linux-QQ-release/releases/download/3.2.28/QQ_3.2.28_260429_amd64_01.deb";
hash = "sha256-aOeddKzcDFpw76jqHYtkELUaIZBoQ3dNOC8y4OOh8Nc=";
};
});
# nixpkgs 走 archive.org 易失败,改用腾讯官方 AppImage
wechat-fixed = pkgs.callPackage "${pkgs.path}/pkgs/by-name/we/wechat/linux.nix" {
pname = "wechat";
version = "4.1.1";
src = pkgs.fetchurl {
url = "https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.AppImage";
hash = "sha256-T1StKQLs1vb9xWgLc1R/gNVCO/RwsBI3pXmi5bPK7us=";
};
meta = pkgs.wechat.meta;
};
# 微信/QQ 在 Wayland 下原生 IME 不稳定,强制 X11 + fcitx IM 模块
fcitxGtkPath = "${pkgs.fcitx5-gtk}/lib/gtk-3.0";
fcitxQt5Path = "${pkgs.libsForQt5.fcitx5-qt}/lib/qt-5.15/plugins";
fcitxQt6Path = "${pkgs.kdePackages.fcitx5-qt}/lib/qt-6/plugins";
wechat-ime = pkgs.writeShellScriptBin "wechat" ''
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export SDL_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export QT_QPA_PLATFORM=xcb
export GTK_PATH="${fcitxGtkPath}''${GTK_PATH:+:$GTK_PATH}"
export QT_PLUGIN_PATH="${fcitxQt5Path}:${fcitxQt6Path}''${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}"
exec ${wechat-fixed}/bin/wechat "$@"
'';
qq-ime = pkgs.stdenvNoCC.mkDerivation {
pname = "qq-ime";
version = qq-fixed.version;
dontUnpack = true;
nativeBuildInputs = [
pkgs.makeWrapper
pkgs.copyDesktopItems
];
desktopItems = [
(pkgs.makeDesktopItem {
name = "qq";
desktopName = "QQ";
genericName = "QQ";
comment = "Tencent QQ";
exec = "qq %U";
icon = "qq";
categories = [
"Network"
"InstantMessaging"
];
startupWMClass = "QQ";
terminal = false;
})
];
installPhase = ''
mkdir -p $out/bin $out/share
makeWrapper ${qq-fixed}/bin/qq $out/bin/qq \
--set GTK_IM_MODULE fcitx \
--set QT_IM_MODULE fcitx \
--set SDL_IM_MODULE fcitx \
--set XMODIFIERS @im=fcitx \
--prefix GTK_PATH : ${fcitxGtkPath} \
--unset NIXOS_OZONE_WL \
--add-flags "--ozone-platform=x11"
if [ -d ${qq-fixed}/share/icons ]; then
cp -a ${qq-fixed}/share/icons $out/share/
fi
runHook postInstall
'';
meta = qq-fixed.meta;
};
in
{
environment.systemPackages = with pkgs; [
wget
curl
google-chrome
wechat-ime
qq-ime
wpsoffice-cn
git
git-credential-manager
gcc
gnumake
binutils
gdb
cmake
pkg-config
autoconf
automake
libtool
ninja
meson
clang
clang-tools
lld
lldb
ccache
bear
valgrind
cppcheck
python3
python3Packages.pip
openssl
zlib
file
unzip
zip
which
tree
htop
ripgrep
fd
smartmontools
lm_sensors
pciutils
usbutils
lshw
bluez
vulkan-tools
libva-utils
mesa-demos
ffmpeg
jq
bat
eza
fzf
btop
# EDA / 媒体
kicad
splayer-next
# 官方二进制:nixpkgs 版发 prompt 会崩(SystemPrompt.environment)
(callPackage ../pkgs/opencode-bin.nix { })
bun # opencode 插件安装需要
cursor-cli
];
}