mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
committed by
Austin Horstman
parent
1768d4e498
commit
755b993165
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user