zsh: make sure siteFunction names don't contain slashes
This commit is contained in:
parent
19c41a5a6d
commit
486595d2cf
1 changed files with 6 additions and 0 deletions
|
|
@ -484,6 +484,12 @@ in
|
|||
})
|
||||
|
||||
(lib.mkIf (cfg.siteFunctions != { }) {
|
||||
assertions = lib.mapAttrsToList (funcName: _text: {
|
||||
assertion = !(lib.hasPrefix "/" funcName);
|
||||
message =
|
||||
"programs.zsh.siteFunctions: function name '${funcName}' cannot start with a '/'. "
|
||||
+ "either rename it, or don't rely on autoloading for that function (e.g. by defining it inside your '.zshrc')";
|
||||
}) cfg.siteFunctions;
|
||||
home.packages = lib.mapAttrsToList (
|
||||
name: pkgs.writeTextDir "share/zsh/site-functions/${name}"
|
||||
) cfg.siteFunctions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue