query
On this page

toShellVars

lib.strings.toShellVars

Docs pulled from | This Revision | 38 minutes ago


Translate an attribute set vars into corresponding shell variable declarations using toShellVar.

Inputs

vars
1. Function argument

Type

toShellVars :: {
  [String] :: String | [String] | { [String] :: String };
} -> String

Examples

lib.strings.toShellVars usage example

let
  foo = "value";
  bar = foo;
in ''
  ${toShellVars { inherit foo bar; }}
  [[ "$foo" == "$bar" ]]
''

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

toShellVars = vars: concatStringsSep "\n" (lib.mapAttrsToList toShellVar vars);