1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

lib/zsh: exportAll add support for indentation

Allow indenting the output level

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-09-28 14:28:54 -05:00
parent c75fd8e300
commit 64a809b198

View file

@ -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);
}