From 5900b644bb5ed65d162e76a8d084e60197453275 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 16 Oct 2024 10:47:04 +0200 Subject: [PATCH] nixos/docker: move live-restore option into daemon.settings Signed-off-by: Sefa Eyeoglu --- nixos/modules/virtualisation/docker.nix | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 4f38bc0b94d6..ed228f76988d 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -52,7 +52,19 @@ in daemon.settings = mkOption { - type = settingsFormat.type; + type = types.submodule { + freeformType = settingsFormat.type; + options = { + live-restore = mkOption { + type = types.bool; + default = true; + description = '' + Allow dockerd to be restarted without affecting running container. + This option is incompatible with docker swarm. + ''; + }; + }; + }; default = { }; example = { ipv6 = true; @@ -75,16 +87,6 @@ in ''; }; - liveRestore = - mkOption { - type = types.bool; - default = true; - description = '' - Allow dockerd to be restarted without affecting running container. - This option is incompatible with docker swarm. - ''; - }; - storageDriver = mkOption { type = types.nullOr (types.enum ["aufs" "btrfs" "devicemapper" "overlay" "overlay2" "zfs"]); @@ -253,7 +255,6 @@ in hosts = [ "fd://" ]; log-driver = mkDefault cfg.logDriver; storage-driver = mkIf (cfg.storageDriver != null) (mkDefault cfg.storageDriver); - live-restore = mkDefault cfg.liveRestore; runtimes = mkIf cfg.enableNvidia { nvidia = { # Use the legacy nvidia-container-runtime wrapper to allow @@ -269,6 +270,7 @@ in imports = [ (mkRemovedOptionModule ["virtualisation" "docker" "socketActivation"] "This option was removed and socket activation is now always active") + (mkAliasOptionModule ["virtualisation" "docker" "liveRestore"] ["virtualisation" "docker" "daemon" "settings" "live-restore"]) ]; }