From f94403a692e15599bfc0990e6556269a06017950 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 12 Sep 2026 15:47:46 +0900 Subject: [PATCH] add mock Signed-off-by: Seongmin Lee --- flake.nix | 5 ++ hosts/mock-eu-1/configuration.nix | 7 +++ hosts/mock-eu-1/disk-config.nix | 62 ++++++++++++++++++++ hosts/prometheus-hel/services/prometheus.nix | 1 + 4 files changed, 75 insertions(+) create mode 100644 hosts/mock-eu-1/configuration.nix create mode 100644 hosts/mock-eu-1/disk-config.nix diff --git a/flake.nix b/flake.nix index bea5db1..4053109 100644 --- a/flake.nix +++ b/flake.nix @@ -128,6 +128,11 @@ target = "46.224.9.195"; }; + mock-eu-1 = { + modules = []; + target = "35.228.210.244"; + }; + pds = { modules = [ ./hosts/pds/services/nginx.nix diff --git a/hosts/mock-eu-1/configuration.nix b/hosts/mock-eu-1/configuration.nix new file mode 100644 index 0000000..633731a --- /dev/null +++ b/hosts/mock-eu-1/configuration.nix @@ -0,0 +1,7 @@ +{...}: { + imports = [./disk-config.nix]; + networking.hostName = "mock-eu-1"; + # GCP serial console is the only recovery path if this box fails to boot. + boot.kernelParams = ["console=ttyS0,115200"]; + system.stateVersion = "25.11"; +} diff --git a/hosts/mock-eu-1/disk-config.nix b/hosts/mock-eu-1/disk-config.nix new file mode 100644 index 0000000..c312b4a --- /dev/null +++ b/hosts/mock-eu-1/disk-config.nix @@ -0,0 +1,62 @@ +# Single GCP persistent disk, LVM pv in vg "pool"; bios-compatible gpt. +{lib, ...}: { + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + swap = { + size = "4G"; + content = { + type = "swap"; + discardPolicy = "once"; + }; + }; + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/prometheus-hel/services/prometheus.nix b/hosts/prometheus-hel/services/prometheus.nix index 36ef4c2..a111078 100644 --- a/hosts/prometheus-hel/services/prometheus.nix +++ b/hosts/prometheus-hel/services/prometheus.nix @@ -118,6 +118,7 @@ in { "knot1-ams:9100" "mirror-fsn:9100" "sandbox-hel:9100" + "mock-eu-n1:9100" "nixery:9100" "spindle-hel:9100" "127.0.0.1:9100" -- 2.51.2