1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00
sops-nix/modules/nix-darwin/with-environment.nix

15 lines
253 B
Nix
Raw Permalink Normal View History

2024-11-03 19:51:58 +00:00
{ cfg, lib }:
sopsCall:
2024-11-17 11:17:45 +00:00
if cfg.environment == { } then
2024-11-03 19:51:58 +00:00
sopsCall
2024-11-17 11:17:45 +00:00
else
''
(
# shellcheck disable=SC2030,SC2031
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: " export ${n}='${v}'") cfg.environment)}
${sopsCall}
)
''