modularize docker swarm config
This commit is contained in:
parent
257afae918
commit
8b8106fade
4 changed files with 103 additions and 104 deletions
|
@ -73,15 +73,13 @@
|
|||
staticNetworking = true;
|
||||
staticIPv4 = config.lab.networking.dmz.ipv4.services;
|
||||
staticIPv6 = config.lab.networking.dmz.ipv6.services;
|
||||
|
||||
shares = [{
|
||||
name = "dnsmasq";
|
||||
mountPoint = "/var/lib/dnsmasq";
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
microvm.shares = [{
|
||||
source = "/var/lib/microvms/${config.networking.hostName}/shares/dnsmasq";
|
||||
mountPoint = "/var/lib/dnsmasq";
|
||||
tag = "dnsmasq";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -90,38 +88,16 @@
|
|||
hypervisorName = "atlas";
|
||||
|
||||
nixosModule = { pkgs, lib, config, ... }: {
|
||||
lab.vm = {
|
||||
id = 1;
|
||||
staticNetworking = true;
|
||||
staticIPv4 = "192.168.30.42";
|
||||
staticIPv6 = "2a0d:6e00:1a77:30::42";
|
||||
lab = {
|
||||
dockerSwarm.enable = true;
|
||||
|
||||
vm = {
|
||||
id = 1;
|
||||
staticNetworking = true;
|
||||
staticIPv4 = "192.168.30.42";
|
||||
staticIPv6 = "2a0d:6e00:1a77:30::42";
|
||||
};
|
||||
};
|
||||
|
||||
microvm.shares = [{
|
||||
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker";
|
||||
mountPoint = "/var/lib/docker";
|
||||
tag = "docker";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
|
||||
networking = {
|
||||
nftables.enable = lib.mkForce false;
|
||||
firewall.enable = lib.mkForce false;
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
liveRestore = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(python311.withPackages (python-pkgs: [
|
||||
python-pkgs.docker
|
||||
python-pkgs.requests
|
||||
python-pkgs.jsondiff
|
||||
python-pkgs.pyyaml
|
||||
]))
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -130,33 +106,10 @@
|
|||
hypervisorName = "jefke";
|
||||
|
||||
nixosModule = { pkgs, lib, config, ... }: {
|
||||
lab.vm.id = 2;
|
||||
|
||||
microvm.shares = [{
|
||||
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker";
|
||||
mountPoint = "/var/lib/docker";
|
||||
tag = "docker";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
|
||||
networking = {
|
||||
nftables.enable = lib.mkForce false;
|
||||
firewall.enable = lib.mkForce false;
|
||||
lab = {
|
||||
dockerSwarm.enable = true;
|
||||
vm.id = 2;
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
liveRestore = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(python311.withPackages (python-pkgs: [
|
||||
python-pkgs.docker
|
||||
python-pkgs.requests
|
||||
python-pkgs.jsondiff
|
||||
python-pkgs.pyyaml
|
||||
]))
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -165,33 +118,10 @@
|
|||
hypervisorName = "lewis";
|
||||
|
||||
nixosModule = { pkgs, lib, config, ... }: {
|
||||
lab.vm.id = 3;
|
||||
|
||||
microvm.shares = [{
|
||||
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker";
|
||||
mountPoint = "/var/lib/docker";
|
||||
tag = "docker";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
|
||||
networking = {
|
||||
nftables.enable = lib.mkForce false;
|
||||
firewall.enable = lib.mkForce false;
|
||||
lab = {
|
||||
dockerSwarm.enable = true;
|
||||
vm.id = 3;
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
liveRestore = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(python311.withPackages (python-pkgs: [
|
||||
python-pkgs.docker
|
||||
python-pkgs.requests
|
||||
python-pkgs.jsondiff
|
||||
python-pkgs.pyyaml
|
||||
]))
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Reference in a new issue