mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
launchd+targets/darwin: Escape XML in plists (#7356)
This patch updates all usage of toPlist such that it escapes any strings in the final output. The motication for this change is to avoid confusion when end-users of home-manager's APIs are not aware that the option values they set end up being passed un-escaped to XML files. BREAKING CHANGE: Consumers doing manual escaping will now be doubly escaped. Co-authored-by: Linnnus <linnnus@users.noreply.github.com>
This commit is contained in:
parent
cc2fa2331a
commit
3ec1cd9a07
8 changed files with 35 additions and 4 deletions
|
|
@ -8,7 +8,9 @@
|
|||
let
|
||||
cfg = config.targets.darwin;
|
||||
homeDir = config.home.homeDirectory;
|
||||
confFile = pkgs.writeText "DefaultKeybinding.dict" (lib.generators.toPlist { } cfg.keybindings);
|
||||
confFile = pkgs.writeText "DefaultKeybinding.dict" (
|
||||
lib.generators.toPlist { escape = true; } cfg.keybindings
|
||||
);
|
||||
in
|
||||
{
|
||||
options.targets.darwin.keybindings = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ let
|
|||
mkActivationCmds =
|
||||
isLocal: settings:
|
||||
let
|
||||
toDefaultsFile = domain: attrs: pkgs.writeText "${domain}.plist" (lib.generators.toPlist { } attrs);
|
||||
toDefaultsFile =
|
||||
domain: attrs: pkgs.writeText "${domain}.plist" (lib.generators.toPlist { escape = true; } attrs);
|
||||
|
||||
cliFlags = lib.optionalString isLocal "-currentHost";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue