Make docker optional

This commit is contained in:
Simon Bruder 2021-01-17 19:32:01 +01:00
parent a68b429a58
commit 21a8f5a358
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 38 additions and 29 deletions

View file

@ -9,6 +9,7 @@
sbruder = {
cpu.intel.enable = true;
docker.enable = true;
games.enable = true;
gpu.intel.enable = true;
gui.enable = true;

View file

@ -9,6 +9,7 @@
sbruder = {
cpu.intel.enable = true;
docker.enable = true;
games.enable = true;
gpu.amd.enable = true;
gui.enable = true;

View file

@ -1,6 +1,12 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
{
# This uses a custom option (instead of `virtualisation.docker.enable`) since
# `virtualisation.oci-containers` conditionally sets
# `virtualisation.docker.enable` and therefore causes an infinite recursion.
options.sbruder.docker.enable = lib.mkEnableOption "docker with ipv6nat";
config = lib.mkIf config.sbruder.docker.enable {
environment.systemPackages = with pkgs; [
docker-compose
docker-credential-helpers
@ -33,4 +39,5 @@
};
environment.etc."modules-load.d/ipv6nat.conf".text = "ip6_tables\n";
};
}