feat: added midnight miner

This commit is contained in:
Nick 2025-11-11 21:18:29 -06:00
parent 618b10bc22
commit c39ad5181e
2 changed files with 29 additions and 4 deletions

View file

@ -78,6 +78,7 @@ in
caddy
logrotate
microvm
midnight
# opencloud
sambaEris
postgresEris

View file

@ -1,10 +1,34 @@
{
flake,
config,
pkgs,
...
}:
let
inherit (flake.config.people) user0;
inherit (flake.config.machines) devices;
mars = devices.mars.name;
ceres = devices.ceres.name;
eris = devices.eris.name;
deimos = devices.deimos.name;
hostname = config.networking.hostName;
deviceLogic =
var0: var1: var2: var3:
if hostname == ceres then
var0
else if hostname == eris then
var1
else if hostname == mars then
var2
else if hostname == deimos then
var3
else
var0;
macOctet = deviceLogic "57" "58" "59" "60";
in
{
microvm = {
@ -13,8 +37,8 @@ in
autostart = true;
config =
let
macAddress = "02:00:00:00:00:57";
workers = 45;
macAddress = "02:00:00:00:00:${macOctet}";
workers = deviceLogic 45 4 6 6;
in
{
environment.systemPackages = [
@ -36,7 +60,7 @@ in
{
type = "tap";
id = "vm-miner";
mac = "02:00:00:00:57:57";
mac = "02:00:00:00:57:${macOctet}";
}
{
type = "user";
@ -44,7 +68,7 @@ in
mac = macAddress;
}
];
mem = 52100;
mem = deviceLogic 52100 5120 22000 1024;
shares = [
{
mountPoint = "/nix/.ro-store";