helm/modules/services/docker.nix

34 lines
691 B
Nix
Raw Normal View History

{ options, config, lib, pkgs, ... }:
2020-04-22 16:55:22 -07:00
with lib;
with lib.my;
let cfg = config.modules.services.docker;
in {
2020-04-22 16:55:22 -07:00
options.modules.services.docker = {
enable = mkBoolOpt false;
2020-04-22 16:55:22 -07:00
};
config = mkIf cfg.enable {
user.packages = with pkgs; [
docker
docker-compose
];
2020-04-22 16:55:22 -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
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 = [];
};
};
};
}