stream: microvmify
This commit is contained in:
parent
4078d6c707
commit
2792bd107c
|
@ -544,7 +544,7 @@
|
||||||
|
|
||||||
stream = nixosSystem' {
|
stream = nixosSystem' {
|
||||||
modules = [
|
modules = [
|
||||||
./config/lxc-container.nix
|
self.nixosModules.microvm
|
||||||
./hosts/containers/stream
|
./hosts/containers/stream
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,17 +1,50 @@
|
||||||
{ zentralwerk, config, pkgs, ... }:
|
{ zentralwerk, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
||||||
|
mac = {
|
||||||
|
pub = "DE:91:C7:51:D1:C5";
|
||||||
|
serv = "C6:40:E0:21:9B:A4";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
networking.hostName = "stream";
|
networking.hostName = "stream";
|
||||||
c3d2.hq.statistics.enable = true;
|
c3d2.hq.statistics.enable = true;
|
||||||
c3d2.autoUpdate = true;
|
c3d2.deployment = {
|
||||||
|
server = "server9";
|
||||||
|
autoNetSetup = false;
|
||||||
|
mounts = [];
|
||||||
|
};
|
||||||
|
microvm.mem = 2048;
|
||||||
|
microvm.interfaces = [ {
|
||||||
|
type = "tap";
|
||||||
|
id = "pub-stream";
|
||||||
|
mac = mac.pub;
|
||||||
|
} {
|
||||||
|
type = "tap";
|
||||||
|
id = "serv-stream";
|
||||||
|
mac = mac.serv;
|
||||||
|
} ];
|
||||||
|
microvm.shares = map (name: {
|
||||||
|
source = "/tank/storage/stream/${name}";
|
||||||
|
mountPoint = "/${name}";
|
||||||
|
tag = name;
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "${name}.socket";
|
||||||
|
}) [ "etc" "home" "var" ];
|
||||||
|
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
links."00-serv" = {
|
||||||
|
matchConfig.MACAddress = mac.serv;
|
||||||
|
linkConfig.Name = "serv";
|
||||||
|
};
|
||||||
|
|
||||||
networks."00-serv" = {
|
networks."00-serv" = {
|
||||||
matchConfig.MACAddress = "C6:40:E0:21:9B:A4";
|
matchConfig.MACAddress = mac.serv;
|
||||||
networkConfig.IPv6AcceptRA = false;
|
networkConfig.IPv6AcceptRA = false;
|
||||||
|
# try harder disabling global ipv6
|
||||||
|
networkConfig.LinkLocalAddressing = "no";
|
||||||
addresses = [ {
|
addresses = [ {
|
||||||
addressConfig.Address = "${config.c3d2.hosts.stream.ip4}/${toString zentralwerk.lib.config.site.net.serv.subnet4Len}";
|
addressConfig.Address = "${config.c3d2.hosts.stream.ip4}/${toString zentralwerk.lib.config.site.net.serv.subnet4Len}";
|
||||||
} ];
|
} ];
|
||||||
|
@ -23,9 +56,15 @@ in
|
||||||
} ];
|
} ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
links."00-pub" = {
|
||||||
|
matchConfig.MACAddress = mac.pub;
|
||||||
|
linkConfig.Name = "pub";
|
||||||
|
};
|
||||||
|
|
||||||
networks."01-pub" = {
|
networks."01-pub" = {
|
||||||
matchConfig.MACAddress = "DE:91:C7:51:D1:C5";
|
matchConfig.MACAddress = mac.pub;
|
||||||
networkConfig.DHCP = "ipv4";
|
networkConfig.DHCP = "ipv4";
|
||||||
|
networkConfig.IPv6AcceptRA = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
@ -63,4 +102,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "22.05";
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ in
|
||||||
{
|
{
|
||||||
options.c3d2.deployment = with lib; {
|
options.c3d2.deployment = with lib; {
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = types.enum [ "server10" ];
|
type = types.enum [ "server9" "server10" ];
|
||||||
description = "Server that is supposed to host this MicroVM.";
|
description = "Server that is supposed to host this MicroVM.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue