1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 12:19:48 +01:00
home-manager/modules/lib/shell.nix

12 lines
381 B
Nix
Raw Normal View History

{ lib }:
rec {
# Produces a Bourne shell like variable export statement.
2020-02-02 00:39:17 +01:00
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);
}