fork/home-manager
git clone https://git.julia.blue/fork/home-manager
b0e0d826
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4let cfg = config . programs . zsh . zsh-abbr ; 5in { 6meta . maintainers = [ hm . maintainers . ilaumjd ]; 7 8options . programs . zsh . zsh-abbr = { 9enable = 10mkEnableOption "zsh-abbr - zsh manager for auto-expanding abbreviations" ; 11 12abbreviations = mkOption { 13type = types . attrsOf types . str ; 14default = { }; 15example = { 16l = "less" ; 17gco = "git checkout" ; 18}; 19description = '' 20An attribute set that maps aliases (the top level attribute names 21in this option) to abbreviations. Abbreviations are expanded with 22the longer phrase after they are entered. 23'' ; 24}; 25}; 26 27config = mkIf cfg . enable { 28programs . zsh . plugins = [{ 29name = "zsh-abbr" ; 30src = pkgs . zsh-abbr ; 31file = "/share/zsh/zsh-abbr/abbr.plugin.zsh" ; 32}]; 33 34xdg . configFile = { 35"zsh-abbr/user-abbreviations" . text = concatStringsSep "\n" 36( mapAttrsToList ( k :v :"abbr ${ escapeShellArg k } = ${ escapeShellArg v } " ) 37cfg . abbreviations ) + "\n" ; 38}; 39}; 40}