1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-15 04:57:51 +00:00
nix-darwin/modules/services/math-symbols-input/custom-commands.nix

15 lines
398 B
Nix
Raw Normal View History

2022-12-22 21:15:24 -07:00
# Converts an attr list to the text file format used by Math Symbols Input.
# for example, the following command attribute set
#
# {"alpha" = "α"; "beta" = "β";}
#
# would be converted to
#
# \alpha α
# \beta β
#
{ writeText, lib }:
commands:
writeText "custom-commands.txt" (builtins.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (name: value: "\\${name} ${value}") commands))