diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-04-22 03:15:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 03:15:14 +0200 |
commit | 027250d7be6d121d2d3917e7fd579bde4519903b (patch) | |
tree | 19a097ae90a24b25d2c9dfa4c02ba2021fba201e /nixos | |
parent | c51f36964d4d8e477c569ccebb600e709261034d (diff) | |
parent | f5922de1d76d9b15856afe7e36e03951ef42a753 (diff) | |
download | nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar.gz nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar.bz2 nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar.lz nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar.xz nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.tar.zst nixpkgs-027250d7be6d121d2d3917e7fd579bde4519903b.zip |
Merge pull request #119379 from Philipp-M/oci-containers-env-file
nixos/oci-containers: add support for environment file(s)
Diffstat (limited to 'nixos')
-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 2dd15e3aba4..ad436ed3014 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 |