From 302c4df41dafb9cf2aef963afe94b3d5bce66f63 Mon Sep 17 00:00:00 2001 From: Johan Thomsen Date: Mon, 11 Feb 2019 23:35:25 +0100 Subject: [PATCH] nixos/dockerPreloader: guard the entire implemetation with mkIf on image list --- nixos/modules/virtualisation/docker-preloader.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/modules/virtualisation/docker-preloader.nix b/nixos/modules/virtualisation/docker-preloader.nix index faa94f53d98f..6ab83058dee1 100644 --- a/nixos/modules/virtualisation/docker-preloader.nix +++ b/nixos/modules/virtualisation/docker-preloader.nix @@ -78,12 +78,11 @@ in }; }; - config = { + config = mkIf (cfg.dockerPreloader.images != []) { assertions = [{ # If docker.storageDriver is null, Docker choose the storage # driver. So, in this case, we cannot be sure overlay2 is used. - assertion = cfg.dockerPreloader.images == [] - || cfg.docker.storageDriver == "overlay2" + assertion = cfg.docker.storageDriver == "overlay2" || cfg.docker.storageDriver == "overlay" || cfg.docker.storageDriver == null; message = "The Docker image Preloader only works with overlay2 storage driver!";