diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index e0a42ff87bab..85c880997692 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -727,6 +727,8 @@ - `lib.misc.mapAttrsFlatten` is now formally deprecated and will be removed in future releases; use the identical [`lib.attrsets.mapAttrsToList`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.mapAttrsToList) instead. +- `virtualisation.docker.liveRestore` has been renamed to `virtualisation.docker.daemon.settings."live-restore"` and turned off by default for state versions of at least 24.11. + - Tailscale's `authKeyFile` can now have its corresponding parameters set through `config.services.tailscale.authKeyParameters`, allowing for non-ephemeral unsupervised deployment and more. See [Registering new nodes using OAuth credentials](https://tailscale.com/kb/1215/oauth-clients#registering-new-nodes-using-oauth-credentials) for the supported options. diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 4f38bc0b94d6..741828c7468a 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -52,10 +52,26 @@ in daemon.settings = mkOption { - type = settingsFormat.type; + type = types.submodule { + freeformType = settingsFormat.type; + options = { + live-restore = mkOption { + type = types.bool; + # Prior to NixOS 24.11, this was set to true by default, while upstream defaulted to false. + # Keep the option unset to follow upstream defaults + default = versionOlder config.system.stateVersion "24.11"; + defaultText = literalExpression "lib.versionOlder config.system.stateVersion \"24.11\""; + description = '' + Allow dockerd to be restarted without affecting running container. + This option is incompatible with docker swarm. + ''; + }; + }; + }; default = { }; example = { ipv6 = true; + "live-restore" = true; "fixed-cidr-v6" = "fd00::/80"; }; description = '' @@ -75,16 +91,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"]); @@ -167,6 +173,11 @@ 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"]) + ]; + ###### implementation config = mkIf cfg.enable (mkMerge [{ @@ -253,7 +264,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 @@ -266,9 +276,4 @@ in }; } ]); - - imports = [ - (mkRemovedOptionModule ["virtualisation" "docker" "socketActivation"] "This option was removed and socket activation is now always active") - ]; - }