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

224 lines
5.8 KiB
Nix
Raw Normal View History

2026-03-03 04:26:35 +00:00
{cerulean, ...} @ inputs:
2026-02-13 23:27:35 +10:00
cerulean.mkNexus ./. (self: {
nexus = {
2026-03-03 04:26:35 +00:00
args = {inherit inputs;};
2026-02-13 23:27:35 +10:00
2026-03-03 04:26:35 +00:00
modules = with inputs; [];
2026-02-13 23:27:35 +10:00
base = inputs.nixpkgs;
homeManager = inputs.home-manager;
groups = {
2026-03-03 04:26:35 +00:00
servers = {};
};
2026-03-03 04:26:35 +00:00
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";
2026-03-03 04:26:35 +00:00
groups = [
groups.servers
];
2026-03-03 04:26:35 +00:00
modules = with inputs; [
microvm.nixosModules.host
2026-03-03 04:26:35 +00:00
{
microvm.vms = {
2026-05-21 00:38:01 +01:00
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";
};
};
};
};
2026-03-03 04:26:35 +00:00
home-assistant = {
autostart = true;
2026-02-19 18:56:57 +00:00
2026-03-03 04:26:35 +00:00
config = {
imports = [./vms/home-assistant/default.nix];
2026-03-03 04:26:35 +00:00
networking.hostName = "home-assistant";
2026-02-19 18:56:57 +00:00
2026-03-03 04:26:35 +00:00
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
2026-05-21 00:38:01 +01:00
mem = 4 * 1024; # 4GB
2026-03-03 04:26:35 +00:00
vcpu = 2;
interfaces = [
{
type = "tap";
id = "vm-hass";
mac = "0a:00:a0:70:01:01";
}
];
volumes = [
2026-05-21 00:38:01 +01:00
{
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";
}
2026-03-03 04:26:35 +00:00
];
};
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";
};
};
};
};
2026-03-03 04:26:35 +00:00
};
}
];
deploy.ssh = {
host = "10.16.1.163";
port = 2222;
user = "foxora";
};
2026-03-03 04:26:35 +00:00
};
2026-02-15 10:42:00 +00:00
2026-03-03 04:26:35 +00:00
lyra = {
system = "x86_64-linux";
2026-03-03 04:26:35 +00:00
groups = [
groups.servers
];
2026-03-03 04:26:35 +00:00
deploy.ssh = {
host = "10.16.1.58";
port = 2222;
user = "foxora";
2026-02-15 10:42:00 +00:00
};
};
2026-05-21 00:38:01 +01:00
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";
};
};
2026-03-03 04:26:35 +00:00
};
2026-02-13 23:27:35 +10:00
};
})