mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:46 +01:00
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)
42 lines
1.6 KiB
Nix
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;
|
|
})
|
|
]
|