nix/module: load plugins using exec-once (#9836)

This commit is contained in:
Amadej Kastelic 2025-04-03 09:43:06 +02:00 committed by GitHub
parent a41b8d5e97
commit b496e2c718
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,13 +126,14 @@ in {
bottomCommandsPrefixes = cfg.bottomPrefixes; bottomCommandsPrefixes = cfg.bottomPrefixes;
} }
{ {
plugin = let "exec-once" = let
mkEntry = entry: mkEntry = entry:
if lib.types.package.check entry if lib.types.package.check entry
then "${entry}/lib/lib${entry.pname}.so" then "${entry}/lib/lib${entry.pname}.so"
else entry; else entry;
hyprctl = lib.getExe' config.programs.hyprland.package "hyprctl";
in in
map mkEntry cfg.plugins; map (p: "${hyprctl} plugin load ${mkEntry p}") cfg.plugins;
}; };
in in
lib.mkIf shouldGenerate { lib.mkIf shouldGenerate {