summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2015-10-04 13:39:52 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2015-10-04 14:34:38 +0200
commit5f17aeb4035057deb1840372f5a0a33098ce1e82 (patch)
treef37477133d86d17368482488859f22dd9a8853d0 /nixos
parent424e6e501a44dc38c610f6d2039dda1cfafe9490 (diff)
downloadnixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar.gz
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar.bz2
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar.lz
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar.xz
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.tar.zst
nixpkgs-5f17aeb4035057deb1840372f5a0a33098ce1e82.zip
nixos/docker: default storageDriver to "devicemapper"
Commit 9bfe92ecee ("docker: Minor improvements, fix failing test") added
the services.docker.storageDriver option, made it mandatory but didn't
give it a default value. This results in an ugly traceback when users
enable docker, if they don't pay enough attention to also set the
storageDriver option. (An attempt was made to add an assertion, but it
didn't work, possibly because of how "mkMerge" works.)

The arguments against a default value were that the optimal value
depends on the filesystem on the host. This is, AFAICT, only in part
true. (It seems some backends are filesystem agnostic.) Also, docker
itself uses a default storage driver, "devicemapper", when no
--storage-driver=x options are given. Hence, we use the same value as
default.

Add a FIXME comment that 'devicemapper' breaks NixOS VM tests (for yet
unknown reasons), so we still run those with the 'overlay' driver.

Closes #10100 and #10217.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/docker.nix4
-rw-r--r--nixos/tests/docker.nix2
2 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix
index 7288cf29875..0c642bf3b81 100644
--- a/nixos/modules/virtualisation/docker.nix
+++ b/nixos/modules/virtualisation/docker.nix
@@ -46,12 +46,10 @@ in
     storageDriver =
       mkOption {
         type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
+        default = "devicemapper";
         description =
           ''
             This option determines which Docker storage driver to use.
-            It is required but lacks a default value as its most
-            suitable value will depend the filesystems available on the
-            host.
           '';
       };
     extraOptions =
diff --git a/nixos/tests/docker.nix b/nixos/tests/docker.nix
index 034dcb04adf..635a97e2ce0 100644
--- a/nixos/tests/docker.nix
+++ b/nixos/tests/docker.nix
@@ -11,6 +11,8 @@ import ./make-test.nix ({ pkgs, ...} : {
       { config, pkgs, ... }:
         {
           virtualisation.docker.enable = true;
+          # FIXME: The default "devicemapper" storageDriver fails in NixOS VM
+          # tests.
           virtualisation.docker.storageDriver = "overlay";
         };
     };