git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit5f17aeb4035057deb1840372f5a0a33098ce1e82 authorBjørn Forsman <bjorn.forsman@gmail.com> dateSun 4 Oct 2015, 13:39 (11 years ago) parent424e6e5
2 files changed+3−3
nixos/modules/virtualisation/docker.nix+1−3 nixos/tests/docker.nix+2
nixos/modules/virtualisation/docker.nix+1−3
@@ -46,12 +46,10 @@ in
4646 storageDriver =
4747 mkOption {
4848 type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
49+ default = "devicemapper";
4950 description =
5051 ''
5152 This option determines which Docker storage driver to use.
52− It is required but lacks a default value as its most
53− suitable value will depend the filesystems available on the
54− host.
5553 '';
5654 };
5755 extraOptions =
nixos/tests/docker.nix+2
@@ -11,6 +11,8 @@ import ./make-test.nix ({ pkgs, ...} : {
1111 { config, pkgs, ... }:
1212 {
1313 virtualisation.docker.enable = true;
14+ # FIXME: The default "devicemapper" storageDriver fails in NixOS VM
15+ # tests.
1416 virtualisation.docker.storageDriver = "overlay";
1517 };
1618 };