Files
nix-config-ryan4yin/home/base/gui/rime/default.nix
T
Ryan Yin c8bbeb708d refactor(overlays): get NUR packages from the nur-ryan4yin overlay
myNurPkgs evaluated a second nixpkgs just for four packages. Apply the
NUR repo's own overlay instead, so they come from the host's pkgs.

Darwin's pkgs now gets nixpkgsConfig too: it set nixpkgs.pkgs, which
ignores nixpkgs.config, so only myNurPkgs carried the npm mirror there.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 11:55:14 -06:00

42 lines
1.6 KiB
Nix

{
lib,
pkgs,
...
}:
let
# flypy (小鹤音形) rime data from nur-ryan4yin (`pkgs/rime-data-flypy`). The
# package stays pristine; personal preferences live in flypy.custom.yaml.
rime-data-flypy = pkgs.rime-data-flypy;
# Personal Rime customisation, layered by Rime on top of the shared rime-data.
custom = ./flypy.custom.yaml;
# Manually maintained user dictionary (custom phrases, symbols, missing
# characters); Rime reads it from the user directory.
user-dict = ./flypy_user.txt;
in
lib.mkMerge [
# Linux: fcitx5-rime, with its user directory in ~/.local/share/fcitx5/rime.
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
# Chinese: flypy (小鹤音形) data instead of the default rime-data.
i18n.inputMethod.fcitx5.addons = [
(pkgs.fcitx5-rime.override { rimeDataPkgs = [ rime-data-flypy ]; })
];
xdg.dataFile."fcitx5/rime/flypy.custom.yaml".source = custom;
xdg.dataFile."fcitx5/rime/flypy_user.txt".source = user-dict;
})
# macOS: Squirrel reads shared data from ~/Library/Rime, so link the data there.
# Its `flypy_user.txt` template overlaps our dictionary, so the regular files
# below must win. This is the only recursive link in the configuration.
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.fileOverlapResolution = "override";
home.file."Library/Rime" = {
source = "${rime-data-flypy}/share/rime-data";
recursive = true;
# overwrite possible existing data dynamically generated by squirrel
force = true;
};
home.file."Library/Rime/flypy.custom.yaml".source = custom;
home.file."Library/Rime/flypy_user.txt".source = user-dict;
})
]