mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08: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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user