From 64a809b198904668c043d662043d17e14498cd54 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 28 Sep 2025 14:28:54 -0500 Subject: [PATCH] lib/zsh: exportAll add support for indentation Allow indenting the output level Signed-off-by: Austin Horstman --- modules/lib/zsh.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/lib/zsh.nix b/modules/lib/zsh.nix index d008ca475..26f0133d6 100644 --- a/modules/lib/zsh.nix +++ b/modules/lib/zsh.nix @@ -30,5 +30,13 @@ rec { # Given an attribute set containing shell variable names and their # assignments, this function produces a string containing an export # statement for each set entry. - exportAll = vars: lib.concatStringsSep "\n" (lib.mapAttrsToList export vars); + exportAll = + vars: + { + indent ? "", + }: + let + separator = if indent == "" then "\n" else "\n" + indent; + in + lib.concatStringsSep separator (lib.mapAttrsToList export vars); }