2020-10-01 15:46:04 -07:00
|
|
|
{ options, config, lib, pkgs, ... }:
|
|
|
|
|
2020-04-22 16:55:22 -07:00
|
|
|
with lib;
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.services.docker;
|
2021-03-01 17:43:12 -08:00
|
|
|
configDir = config.dotfiles.configDir;
|
2020-10-01 15:46:04 -07:00
|
|
|
in {
|
2020-04-22 16:55:22 -07:00
|
|
|
options.modules.services.docker = {
|
2020-10-01 15:46:04 -07:00
|
|
|
enable = mkBoolOpt false;
|
2020-04-22 16:55:22 -07:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
user.packages = with pkgs; [
|
|
|
|
docker
|
|
|
|
docker-compose
|
|
|
|
];
|
2020-04-22 16:55:22 -07:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
env.DOCKER_CONFIG = "$XDG_CONFIG_HOME/docker";
|
|
|
|
env.MACHINE_STORAGE_PATH = "$XDG_DATA_HOME/docker/machine";
|
2020-04-22 16:55:22 -07:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
user.extraGroups = [ "docker" ];
|
|
|
|
|
|
|
|
modules.shell.zsh.rcFiles = [ "${configDir}/docker/aliases.zsh" ];
|
2020-04-22 16:55:22 -07:00
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
docker = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
|
|
|
enableOnBoot = false;
|
|
|
|
# listenOptions = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|