Docker : Disable autostart by default.
This commit is contained in:
parent
4bdec48282
commit
514523e4f0
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, config, ... }: with lib; let
|
{ lib, config, ... }: with lib; let
|
||||||
cfg = config.module.docker;
|
cfg = config.module.docker;
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
|
@ -15,27 +15,24 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
|
||||||
virtualisation.docker.rootless = mkIf cfg.rootless {
|
systemd = {
|
||||||
|
services = {
|
||||||
|
docker-prune.enable = mkForce cfg.autostart;
|
||||||
|
docker.enable = mkForce cfg.autostart;
|
||||||
|
};
|
||||||
|
sockets.docker.enable = mkForce cfg.autostart;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.rootless {
|
||||||
|
virtualisation.docker.rootless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
setSocketVariable = true;
|
setSocketVariable = true;
|
||||||
};
|
};
|
||||||
|
})
|
||||||
systemd.services.docker-prune.enable = mkForce cfg.autostart;
|
]);
|
||||||
systemd.services.docker.enable = mkForce cfg.autostart;
|
|
||||||
systemd.sockets.docker.enable = mkForce cfg.autostart;
|
|
||||||
};
|
|
||||||
|
|
||||||
# NOTE: mkMerge example.
|
|
||||||
# config = mkIf cfg.enable (mkMerge [
|
|
||||||
# { virtualisation.docker.enable = true; }
|
|
||||||
# (mkIf cfg.rootless {
|
|
||||||
# virtualisation.docker.rootless = {
|
|
||||||
# enable = true;
|
|
||||||
# setSocketVariable = true;
|
|
||||||
# };
|
|
||||||
# })
|
|
||||||
# ]);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue