feat: replace home.activation.xxx via home.file.<name>.force

This commit is contained in:
Ryan Yin
2023-12-20 10:45:01 +08:00
parent 29511fa574
commit 58b02a6b16
3 changed files with 11 additions and 22 deletions

View File

@@ -1,23 +1,19 @@
{
pkgs,
config,
lib,
catppuccin-fcitx5,
...
}: {
home.file.".config/fcitx5/profile".source = ./profile;
home.file.".config/fcitx5/profile" = {
source = ./profile;
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile,
# so we need to force replace it in every rebuild to avoid file conflict.
force = true;
};
# color schema
home.file.".local/share/fcitx5/themes".source = "${catppuccin-fcitx5}/src";
home.file.".config/fcitx5/conf/classicui.conf".source = ./classicui.conf;
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile file,
# which will override my config managed by home-manager
# so we need to remove it before everytime we rebuild the config
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f "${config.xdg.configHome}/fcitx5/profile"
'';
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [