Commit 3782b3b5 authored by Elliot Speck (Arcayr)'s avatar Elliot Speck (Arcayr)
Browse files

nixos/virtualisation: add hostname option to oci-containers.

parent 1f0e8ac1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -203,6 +203,13 @@ let
          '';
        };

        hostname = mkOption {
          type = with types; nullOr str;
          default = null;
          description = lib.mdDoc "The hostname of the container.";
          example = "hello-world";
        };

        extraOptions = mkOption {
          type = with types; listOf str;
          default = [];
@@ -266,6 +273,8 @@ let
      "--log-driver=${container.log-driver}"
    ] ++ optional (container.entrypoint != null)
      "--entrypoint=${escapeShellArg container.entrypoint}"
      ++ optional (container.hostname != null)
      "--hostname=${escapeShellArg container.hostname}"
      ++ lib.optionals (cfg.backend == "podman") [
        "--cidfile=/run/podman-${escapedName}.ctr-id"
        "--cgroups=no-conmon"