about summary refs log tree commit diff
path: root/nixos/modules/virtualisation/oci-containers.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/virtualisation/oci-containers.nix')
-rw-r--r--nixos/modules/virtualisation/oci-containers.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/oci-containers.nix b/nixos/modules/virtualisation/oci-containers.nix
index 4308d410c69c7..f4fa934231798 100644
--- a/nixos/modules/virtualisation/oci-containers.nix
+++ b/nixos/modules/virtualisation/oci-containers.nix
@@ -221,6 +221,13 @@ let
           example = "hello-world";
         };
 
+        preRunExtraOptions = mkOption {
+          type = with types; listOf str;
+          default = [];
+          description = "Extra options for {command}`${defaultBackend}` that go before the `run` argument.";
+          example = [ "--runtime" "runsc" ];
+        };
+
         extraOptions = mkOption {
           type = with types; listOf str;
           default = [];
@@ -284,7 +291,9 @@ let
       else throw "Unhandled backend: ${cfg.backend}";
 
     script = concatStringsSep " \\\n  " ([
-      "exec ${cfg.backend} run"
+      "exec ${cfg.backend} "
+    ]  ++ map escapeShellArg container.preRunExtraOptions ++ [
+      "run"
       "--rm"
       "--name=${escapedName}"
       "--log-driver=${container.log-driver}"