fish: fix handler function sourcing

The isHandler filter, rather than checking if the function _has_ any
handler attribute, now checks if the function has any handler attribute
_that is not null_. This prevents non-handler functions defined as an
attrset (as opposed to a string) from being sourced in config.fish.
This commit is contained in:
SunOfLife1
2026-05-09 00:24:02 -04:00
committed by Austin Horstman
parent 1768d4e498
commit 755b993165

View File

@@ -421,7 +421,7 @@ let
"onSignal"
"onEvent"
];
isHandler = _name: def: isAttrs def && builtins.any (attr: builtins.hasAttr attr def) handlerAttrs;
isHandler = _name: def: isAttrs def && builtins.any (attr: def.${attr} != null) handlerAttrs;
handlerFunctions = lib.filterAttrs isHandler cfg.functions;
sourceFunction = name: _def: "source ${config.xdg.configHome}/fish/functions/${name}.fish";
in