diff options
author | Philipp Mildenberger <philipp@mildenberger.me> | 2021-04-14 01:39:27 +0200 |
---|---|---|
committer | Philipp Mildenberger <philipp@mildenberger.me> | 2021-04-15 10:57:56 +0200 |
commit | f5922de1d76d9b15856afe7e36e03951ef42a753 (patch) | |
tree | e946c6b66f2fba6d5abb467b9540cfc53934b391 | |
parent | 7bf3b1fe952dcc59a8d3e9c5f6c99d6401ee49c7 (diff) | |
download | nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar.gz nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar.bz2 nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar.lz nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar.xz nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.tar.zst nixlib-f5922de1d76d9b15856afe7e36e03951ef42a753.zip |
nixos/oci-containers: add support for environment files
-rw-r--r-- | nixos/modules/virtualisation/oci-containers.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/oci-containers.nix b/nixos/modules/virtualisation/oci-containers.nix index 2dd15e3aba45..ad436ed30146 100644 --- a/nixos/modules/virtualisation/oci-containers.nix +++ b/nixos/modules/virtualisation/oci-containers.nix @@ -59,6 +59,18 @@ let ''; }; + environmentFiles = mkOption { + type = with types; listOf path; + default = []; + description = "Environment files for this container."; + example = literalExample '' + [ + /path/to/.env + /path/to/.env.secret + ] + ''; + }; + log-driver = mkOption { type = types.str; default = "journald"; @@ -236,6 +248,7 @@ let ] ++ optional (container.entrypoint != null) "--entrypoint=${escapeShellArg container.entrypoint}" ++ (mapAttrsToList (k: v: "-e ${escapeShellArg k}=${escapeShellArg v}") container.environment) + ++ map (f: "--env-file ${escapeShellArg f}") container.environmentFiles ++ map (p: "-p ${escapeShellArg p}") container.ports ++ optional (container.user != null) "-u ${escapeShellArg container.user}" ++ map (v: "-v ${escapeShellArg v}") container.volumes |