Unverified Commit a1592fb4 authored by adisbladis's avatar adisbladis Committed by GitHub
Browse files

Merge pull request #258299 from Arcayr/virtualisation-hostname

nixos/virtualisation: add hostname option to oci-containers.
parents d87836b3 3782b3b5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -214,6 +214,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 = [];
@@ -280,6 +287,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"