diff --git a/modules/system/docker.nix b/modules/system/docker.nix new file mode 100644 index 0000000..4b7f53c --- /dev/null +++ b/modules/system/docker.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, user, ... }: +let + this = config.system.docker; + graphical = config.my.graphical; +in +with lib; { + options = { + system.docker.enable = mkOption { + default = true; + type = with types; bool; + }; + }; + + config = mkIf this.enable { + virtualisation.docker = { + enable = true; + autoPrune.enable = true; + }; + + users.users."${user.name}".extraGroups = [ "docker" ]; + + # This is the old version of docker-compose. run "docker compose" for the v2 implementation. + environment.systemPackages = with pkgs; [ docker-compose ]; + }; +}