1
0
Fork 0
forked from foxora/nix
flake-foxora/snow.nix

223 lines
5.8 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 = {
equinox = {
autostart = true;
config = {config, ...}: {
imports = [./vms/equinox/default.nix];
networking.hostName = "equinox";
microvm = {
hypervisor = "qemu";
mem = 48 * 1024; # 48GB
vcpu = 16;
interfaces = [
{
type = "tap";
id = "vm-equinox";
mac = "0a:00:a0:70:01:02";
}
];
writableStoreOverlay = "/nix/.rw-store";
volumes = [
{
image = "data.img";
mountPoint = "/home/foxora";
autoCreate = true;
size = 256 * 1024; # 256GB
}
{
image = "nix-store-overlay.img";
mountPoint = config.microvm.writableStoreOverlay;
size = 8 * 1024; # 8GB
}
];
shares = [
{
# shares the host's nix store with the vm
# to prevent huge images
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}
];
};
systemd.network.enable = true;
systemd.network.networks."20-lan" = {
matchConfig.Type = "ether";
networkConfig = {
Address = ["10.16.1.42/24"];
Gateway = "10.16.1.1";
DNS = ["10.16.1.1"];
IPv6AcceptRA = true;
DHCP = "yes";
};
};
};
};
home-assistant = {
autostart = true;
config = {
imports = [./vms/home-assistant/default.nix];
networking.hostName = "home-assistant";
microvm = {
hypervisor = "qemu";
# 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 = 4 * 1024; # 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 = true;
size = 32 * 1024; # 32GB
}
];
shares = [
{
# shares the host's nix store with the vm
# to prevent huge images
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}
];
};
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";
};
};
lunata = {
system = "x86_64-linux";
groups = [
groups.servers
];
deploy.ssh = {
remoteBuild = false;
host = "176.58.114.228";
port = 4070;
user = "foxora";
};
};
delphinus = {
system = "x86_64-linux";
groups = [
groups.servers
];
deploy.ssh = {
remoteBuild = false;
host = "172.233.47.244";
port = 4070;
user = "foxora";
};
};
};
};
})