nix/config/Docker.nix

29 lines
505 B
Nix
Raw Normal View History

{
2024-11-04 04:37:29 +03:00
lib,
config,
...
}: let
cfg = config.module.docker;
in {
config = lib.mkIf cfg.enable (lib.mkMerge [
{
virtualisation.docker.enable = true;
2024-06-25 04:04:39 +03:00
2024-11-04 04:37:29 +03:00
systemd = if cfg.autostart then { } else {
sockets.docker.wantedBy = lib.mkForce [ ];
services = {
docker-prune.wantedBy = lib.mkForce [ ];
docker.wantedBy = lib.mkForce [ ];
};
};
}
2024-06-25 04:04:39 +03:00
2024-11-04 04:37:29 +03:00
(lib.mkIf cfg.rootless {
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
})
]);
}