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 caddy
logrotate logrotate
microvm microvm
midnight
# opencloud # opencloud
sambaEris sambaEris
postgresEris postgresEris

View file

@ -1,10 +1,34 @@
{ {
flake, flake,
config,
pkgs, pkgs,
... ...
}: }:
let let
inherit (flake.config.people) user0; 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 in
{ {
microvm = { microvm = {
@ -13,8 +37,8 @@ in
autostart = true; autostart = true;
config = config =
let let
macAddress = "02:00:00:00:00:57"; macAddress = "02:00:00:00:00:${macOctet}";
workers = 45; workers = deviceLogic 45 4 6 6;
in in
{ {
environment.systemPackages = [ environment.systemPackages = [
@ -36,7 +60,7 @@ in
{ {
type = "tap"; type = "tap";
id = "vm-miner"; id = "vm-miner";
mac = "02:00:00:00:57:57"; mac = "02:00:00:00:57:${macOctet}";
} }
{ {
type = "user"; type = "user";
@ -44,7 +68,7 @@ in
mac = macAddress; mac = macAddress;
} }
]; ];
mem = 52100; mem = deviceLogic 52100 5120 22000 1024;
shares = [ shares = [
{ {
mountPoint = "/nix/.ro-store"; mountPoint = "/nix/.ro-store";