summaryrefslogtreecommitdiffstats
path: root/nixos/modules/virtualisation/docker.nix
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-07-20 14:28:49 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-07-20 14:28:49 +0100
commit23187c343109f5420f56f52107dce29b65bcf48f (patch)
tree402a901cc815a6b87635759a7503f392360f157b /nixos/modules/virtualisation/docker.nix
parent615f64dcbe6de193a9c3b0e03591fe623fecaeb1 (diff)
docker: allow the user to override postStart
My use-case: passing -H SOM.EIP.ADD.RES:PORT doesn't result in a .sock file so the service would never go up.
Diffstat (limited to 'nixos/modules/virtualisation/docker.nix')
-rw-r--r--nixos/modules/virtualisation/docker.nix21
1 files changed, 16 insertions, 5 deletions
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix
index ef9cc2280db7..2339cf7c6490 100644
--- a/nixos/modules/virtualisation/docker.nix
+++ b/nixos/modules/virtualisation/docker.nix
@@ -54,6 +54,21 @@ in
'';
};
+ postStart =
+ mkOption {
+ type = types.string;
+ default = ''
+ while ! [ -e /var/run/docker.sock ]; do
+ sleep 0.1
+ done
+ '';
+ description = ''
+ The postStart phase of the systemd service. You may need to
+ override this if you are passing in flags to docker which
+ don't cause the socket file to be created.
+ '';
+ };
+
};
@@ -106,11 +121,7 @@ in
path = [ pkgs.kmod ];
environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
- postStart = ''
- while ! [ -e /var/run/docker.sock ]; do
- sleep 0.1
- done
- '';
+ postStart = cfg.postStart;
# Presumably some containers are running we don't want to interrupt
restartIfChanged = false;