forked from foxora/nix
format with prettier formatter :3
This commit is contained in:
parent
8b1a6aca39
commit
211fa03252
18 changed files with 480 additions and 500 deletions
205
snow.nix
205
snow.nix
|
|
@ -1,136 +1,135 @@
|
|||
{ cerulean, ... }@inputs:
|
||||
{cerulean, ...} @ inputs:
|
||||
cerulean.mkNexus ./. (self: {
|
||||
nexus = {
|
||||
args = { inherit inputs; };
|
||||
args = {inherit inputs;};
|
||||
|
||||
modules = with inputs; [ ];
|
||||
modules = with inputs; [];
|
||||
|
||||
base = inputs.nixpkgs;
|
||||
homeManager = inputs.home-manager;
|
||||
|
||||
groups = {
|
||||
servers = { };
|
||||
servers = {};
|
||||
};
|
||||
|
||||
nodes =
|
||||
let
|
||||
inherit (self.nexus)
|
||||
groups
|
||||
;
|
||||
in
|
||||
{
|
||||
nixarawrui = {
|
||||
system = "x86_64-linux";
|
||||
nodes = let
|
||||
inherit
|
||||
(self.nexus)
|
||||
groups
|
||||
;
|
||||
in {
|
||||
nixarawrui = {
|
||||
system = "x86_64-linux";
|
||||
|
||||
base = inputs.nixpkgs-unstable;
|
||||
homeManager = inputs.home-manager-unstable;
|
||||
base = inputs.nixpkgs-unstable;
|
||||
homeManager = inputs.home-manager-unstable;
|
||||
|
||||
modules = with inputs; [
|
||||
sddm-silent.nixosModules.default
|
||||
inputs.mango.nixosModules.mango
|
||||
];
|
||||
};
|
||||
modules = with inputs; [
|
||||
sddm-silent.nixosModules.default
|
||||
inputs.mango.nixosModules.mango
|
||||
];
|
||||
};
|
||||
|
||||
arcturus = {
|
||||
system = "x86_64-linux";
|
||||
arcturus = {
|
||||
system = "x86_64-linux";
|
||||
|
||||
groups = [
|
||||
groups.servers
|
||||
];
|
||||
groups = [
|
||||
groups.servers
|
||||
];
|
||||
|
||||
modules = with inputs; [
|
||||
microvm.nixosModules.host
|
||||
modules = with inputs; [
|
||||
microvm.nixosModules.host
|
||||
|
||||
{
|
||||
microvm.vms = {
|
||||
home-assistant = {
|
||||
autostart = true;
|
||||
{
|
||||
microvm.vms = {
|
||||
home-assistant = {
|
||||
autostart = true;
|
||||
|
||||
config = {
|
||||
imports = [ ./vms/home-assistant/default.nix ];
|
||||
config = {
|
||||
imports = [./vms/home-assistant/default.nix];
|
||||
|
||||
networking.hostName = "home-assistant";
|
||||
networking.hostName = "home-assistant";
|
||||
|
||||
boot.kernelParams = [
|
||||
"console=ttyS0"
|
||||
"console=ttyS1"
|
||||
"8250.nr_uarts=2"
|
||||
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"
|
||||
];
|
||||
systemd.services."serial-getty@ttyS1".enable = true;
|
||||
|
||||
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 = 4096; # 4GB
|
||||
vcpu = 2;
|
||||
|
||||
# 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"
|
||||
];
|
||||
interfaces = [
|
||||
{
|
||||
type = "tap";
|
||||
id = "vm-hass";
|
||||
mac = "0a:00:a0:70:01:01";
|
||||
}
|
||||
];
|
||||
|
||||
# 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;
|
||||
volumes = [
|
||||
#{
|
||||
#image = "/var/lib/microvms/home-assistant/data.img";
|
||||
#mountPoint = "/var/lib/hass";
|
||||
#autoCreate = false;
|
||||
#}
|
||||
];
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
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";
|
||||
};
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue