about summary refs log tree commit diff
path: root/nixos/modules/virtualisation/docker.nix
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2017-09-04 19:02:05 -0400
committerTim Steinbach <tim@nequissimus.com>2017-09-04 19:02:05 -0400
commit2bb57ef7761fc9d408bb27b2733d36c8640e0e4b (patch)
tree7feaa2e37d357f05d60358b7b42244104bdb577a /nixos/modules/virtualisation/docker.nix
parent11cd027b306057f75806b4f9a108fcf8a856601f (diff)
docker: Allow package selection in module
Diffstat (limited to 'nixos/modules/virtualisation/docker.nix')
-rw-r--r--nixos/modules/virtualisation/docker.nix17
1 files changed, 13 insertions, 4 deletions
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix
index 5a8a0e27436f1..a9a2095499a73 100644
--- a/nixos/modules/virtualisation/docker.nix
+++ b/nixos/modules/virtualisation/docker.nix
@@ -126,14 +126,23 @@ in
         '';
       };
     };
+
+    package = mkOption {
+      default = pkgs.docker;
+      type = types.package;
+      example = pkgs.docker-edge;
+      description = ''
+        Docker package to be used in the module.
+      '';
+    };
   };
 
   ###### implementation
 
   config = mkIf cfg.enable (mkMerge [{
-      environment.systemPackages = [ pkgs.docker ];
+      environment.systemPackages = [ cfg.package ];
       users.extraGroups.docker.gid = config.ids.gids.docker;
-      systemd.packages = [ pkgs.docker ];
+      systemd.packages = [ cfg.package ];
 
       systemd.services.docker = {
         wantedBy = optional cfg.enableOnBoot "multi-user.target";
@@ -142,7 +151,7 @@ in
           ExecStart = [
             ""
             ''
-              ${pkgs.docker}/bin/dockerd \
+              ${cfg.package}/bin/dockerd \
                 --group=docker \
                 --host=fd:// \
                 --log-driver=${cfg.logDriver} \
@@ -180,7 +189,7 @@ in
         serviceConfig.Type = "oneshot";
 
         script = ''
-          ${pkgs.docker}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
+          ${cfg.package}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
         '';
 
         startAt = optional cfg.autoPrune.enable cfg.autoPrune.dates;