tvl-depot/users/glittershark/system/home/modules/lib/zshFunctions.nix
Vincent Ambo 81564185e9 Add 'users/glittershark/system/' from commit '3b174300ae60f63f50427cde3bfd680fd3043c3a'
git-subtree-dir: users/glittershark/system
git-subtree-mainline: 85d82a9dc2
git-subtree-split: 3b174300ae
2020-06-16 01:02:24 +01:00

21 lines
455 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
options = {
programs.zsh.functions = mkOption {
description = "An attribute set that maps function names to their source";
default = {};
type = with types; attrsOf (either str path);
};
};
config.programs.zsh.initExtra = concatStringsSep "\n" (
mapAttrsToList (name: funSrc: ''
function ${name}() {
${funSrc}
}
'') config.programs.zsh.functions
);
}