diff options
Diffstat (limited to 'home-manager/modules/lib/shell.nix')
-rw-r--r-- | home-manager/modules/lib/shell.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/home-manager/modules/lib/shell.nix b/home-manager/modules/lib/shell.nix new file mode 100644 index 00000000000..f1443c5466a --- /dev/null +++ b/home-manager/modules/lib/shell.nix @@ -0,0 +1,11 @@ +{ lib }: + +rec { + # Produces a Bourne shell like variable export statement. + export = n: v: "export ${n}=\"${toString v}\""; + + # Given an attribute set containing shell variable names and their + # assignment, this function produces a string containing an export + # statement for each set entry. + exportAll = vars: lib.concatStringsSep "\n" (lib.mapAttrsToList export vars); +} |