mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
fcitx5: ensure config doesn't get overwritten (#6940)
fcitx5 overwrites config files unless the entire folder is readonly. With this PR, a single fcitx5 symlink is made instead of multiple fcitx5/* ones. The link is only created when relevant options are set.
This commit is contained in:
parent
c9c2c1a14e
commit
272eb00d13
1 changed files with 11 additions and 9 deletions
|
|
@ -217,21 +217,23 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
configFile =
|
configFile.fcitx5 =
|
||||||
let
|
let
|
||||||
optionalFile =
|
optionalFile =
|
||||||
p: f: v:
|
p: f: v:
|
||||||
lib.optionalAttrs (v != { }) {
|
lib.optionalAttrs (v != { }) {
|
||||||
"fcitx5/${p}".source = f "fcitx5-${builtins.replaceStrings [ "/" ] [ "-" ] p}" v;
|
${p} = f "fcitx5-${builtins.replaceStrings [ "/" ] [ "-" ] p}" v;
|
||||||
};
|
};
|
||||||
in
|
entries = lib.attrsets.mergeAttrsList [
|
||||||
lib.attrsets.mergeAttrsList [
|
|
||||||
(optionalFile "config" iniFormat.generate cfg.settings.globalOptions)
|
(optionalFile "config" iniFormat.generate cfg.settings.globalOptions)
|
||||||
(optionalFile "profile" iniFormat.generate cfg.settings.inputMethod)
|
(optionalFile "profile" iniFormat.generate cfg.settings.inputMethod)
|
||||||
(lib.concatMapAttrs (
|
(lib.concatMapAttrs (
|
||||||
name: value: optionalFile "conf/${name}.conf" iniGlobalFormat.generate value
|
name: value: optionalFile "conf/${name}.conf" iniGlobalFormat.generate value
|
||||||
) cfg.settings.addons)
|
) cfg.settings.addons)
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
lib.mkIf (entries != { }) { source = pkgs.linkFarm "fcitx-config" entries; };
|
||||||
|
|
||||||
dataFile = lib.concatMapAttrs (
|
dataFile = lib.concatMapAttrs (
|
||||||
name: attrs:
|
name: attrs:
|
||||||
let
|
let
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue