tvl-depot/users/glittershark/system/home/modules/lib/zshFunctions.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
455 B
Nix
Raw Normal View History

2020-06-08 16:19:05 +02:00
{ 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
);
}