1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-14 20:56:37 +00:00
nix-darwin/modules/services/math-symbols-input/custom-commands.nix
2022-12-22 21:15:24 -07:00

14 lines
398 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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))