136 lines
3.7 KiB
Nix
136 lines
3.7 KiB
Nix
{ cerulean, ... }@inputs:
|
|
cerulean.mkNexus ./. (self: {
|
|
nexus = {
|
|
args = { inherit inputs; };
|
|
|
|
modules = with inputs; [ ];
|
|
|
|
base = inputs.nixpkgs;
|
|
homeManager = inputs.home-manager;
|
|
|
|
groups = {
|
|
servers = { };
|
|
};
|
|
|
|
nodes =
|
|
let
|
|
inherit (self.nexus)
|
|
groups
|
|
;
|
|
in
|
|
{
|
|
nixarawrui = {
|
|
system = "x86_64-linux";
|
|
|
|
base = inputs.nixpkgs-unstable;
|
|
homeManager = inputs.home-manager-unstable;
|
|
|
|
modules = with inputs; [
|
|
sddm-silent.nixosModules.default
|
|
inputs.mango.nixosModules.mango
|
|
];
|
|
};
|
|
|
|
arcturus = {
|
|
system = "x86_64-linux";
|
|
|
|
groups = [
|
|
groups.servers
|
|
];
|
|
|
|
modules = with inputs; [
|
|
microvm.nixosModules.host
|
|
|
|
{
|
|
microvm.vms = {
|
|
home-assistant = {
|
|
autostart = true;
|
|
|
|
config = {
|
|
imports = [ ./vms/home-assistant/default.nix ];
|
|
|
|
networking.hostName = "home-assistant";
|
|
|
|
boot.kernelParams = [
|
|
"console=ttyS0"
|
|
"console=ttyS1"
|
|
"8250.nr_uarts=2"
|
|
];
|
|
systemd.services."serial-getty@ttyS1".enable = true;
|
|
|
|
microvm = {
|
|
hypervisor = "qemu";
|
|
|
|
# needed to get interface working
|
|
qemu.extraArgs = [
|
|
"-monitor"
|
|
"unix:/var/lib/microvms/home-assistant/monitor.sock,server,nowait"
|
|
"-chardev"
|
|
"socket,id=serial1,path=/var/lib/microvms/home-assistant/serial.sock,server=on,wait=off"
|
|
"-serial"
|
|
"chardev:serial1"
|
|
];
|
|
|
|
# memory cannot be 2GB so i doubled it and used 4GB:
|
|
# https://github.com/microvm-nix/microvm.nix/issues/171
|
|
# TODO: can be fixed by turning off acpi in qemu
|
|
mem = 4096; # 4GB
|
|
vcpu = 2;
|
|
|
|
interfaces = [
|
|
{
|
|
type = "tap";
|
|
id = "vm-hass";
|
|
mac = "0a:00:a0:70:01:01";
|
|
}
|
|
];
|
|
|
|
volumes = [
|
|
#{
|
|
#image = "/var/lib/microvms/home-assistant/data.img";
|
|
#mountPoint = "/var/lib/hass";
|
|
#autoCreate = false;
|
|
#}
|
|
];
|
|
};
|
|
|
|
systemd.network.enable = true;
|
|
systemd.network.networks."20-lan" = {
|
|
matchConfig.Type = "ether";
|
|
networkConfig = {
|
|
Address = [ "10.16.1.127/24" ];
|
|
Gateway = "10.16.1.1";
|
|
DNS = [ "10.16.1.1" ];
|
|
IPv6AcceptRA = true;
|
|
DHCP = "yes";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
];
|
|
|
|
deploy.ssh = {
|
|
host = "10.16.1.163";
|
|
port = 2222;
|
|
user = "foxora";
|
|
};
|
|
};
|
|
|
|
lyra = {
|
|
system = "x86_64-linux";
|
|
|
|
groups = [
|
|
groups.servers
|
|
];
|
|
|
|
deploy.ssh = {
|
|
host = "10.16.1.58";
|
|
port = 2222;
|
|
user = "foxora";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
})
|