diff --git a/nixos/modules/i18n/input-method/fcitx5.nix b/nixos/modules/i18n/input-method/fcitx5.nix index 8156f424b2cb..06b1000c9959 100644 --- a/nixos/modules/i18n/input-method/fcitx5.nix +++ b/nixos/modules/i18n/input-method/fcitx5.nix @@ -117,7 +117,9 @@ in i18n.inputMethod.fcitx5.addons = lib.optionals (cfg.quickPhrase != { }) [ (pkgs.writeTextDir "share/fcitx5/data/QuickPhrase.mb" ( - lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.quickPhrase) + lib.mapAttrsToList ( + name: value: "${name} ${builtins.replaceStrings [ "\\" "\n" ] [ "\\\\" "\\n" ] value}" + ) cfg.quickPhrase )) ] ++ lib.optionals (cfg.quickPhraseFiles != { }) [