query
On this page

toShellVars

lib.toShellVars

Docs pulled from | This Revision | about 2 hours ago


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

Inputs

vars
1. Function argument

Type

toShellVars :: {
  ${name} :: string | [ string ] | { ${key} :: string; };
} -> string

Examples

lib.strings.toShellVars usage example

let
  foo = "value";
  bar = foo;
in ''
  ${toShellVars { inherit foo bar; }}
  [[ "$foo" == "$bar" ]]
''
(lib.strings.toShellVars)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

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