aboutsummaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2026-07-17 14:34:18 +0200
committerKaran Jayachandra <karan.jayachandra@nxp.com>2026-07-17 14:34:18 +0200
commit0d0788cd4ee378fba19e47a2c5d5527c196b65e0 (patch)
tree0fbd0e2644e94e0227005947004541fd4ff4d53e /hosts
Initial commit
Diffstat (limited to 'hosts')
-rw-r--r--hosts/eurovm/default.nix32
-rw-r--r--hosts/eurovm/disko.nix47
-rw-r--r--hosts/eurovm/hardware.nix32
3 files changed, 111 insertions, 0 deletions
diff --git a/hosts/eurovm/default.nix b/hosts/eurovm/default.nix
new file mode 100644
index 0000000..6c92b67
--- /dev/null
+++ b/hosts/eurovm/default.nix
@@ -0,0 +1,32 @@
+{ config, pkgs, ... }:
+
+{
+ imports = [
+ ./hardware.nix
+ ./disko.nix
+ ../../modules/common.nix
+ ../../modules/sops.nix
+ ../../modules/caddy.nix
+ ../../modules/adguard.nix
+ ../../modules/miniflux.nix
+ ../../modules/actual.nix
+ ../../modules/cgit.nix
+ ];
+
+ networking.hostName = "eurovm";
+
+ # Admin user - authorized SSH keys for both Einstein and Galileo devices
+ users.users.admin = {
+ isNormalUser = true;
+ extraGroups = [ "wheel" ];
+ openssh.authorizedKeys.keys = [
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwAgL0o4NVonSG07Xu4Eai84ns4AjoZj2V7dGC9nXit karanjayachandra@Einstein.local"
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH+qnLTnorv+I2rSSfGjNiCuX/W5AxoNgAdu+cTOyKzW Galileo"
+ ];
+ };
+
+ # Allow admin to use sudo
+ security.sudo.wheelNeedsPassword = false;
+
+ system.stateVersion = "24.11";
+}
diff --git a/hosts/eurovm/disko.nix b/hosts/eurovm/disko.nix
new file mode 100644
index 0000000..d1ec85c
--- /dev/null
+++ b/hosts/eurovm/disko.nix
@@ -0,0 +1,47 @@
+{ ... }:
+
+# Disk layout for nixos-anywhere + disko.
+# Targets a single virtio disk (typical for Hetzner Cloud).
+# GPT with a BIOS-boot partition so GRUB works without UEFI.
+{
+ disko.devices = {
+ disk.main = {
+ # Hetzner Cloud primary disk is /dev/sda on most instance types.
+ # On NVMe instances it will be /dev/nvme0n1 - update accordingly.
+ device = "/dev/sda";
+ type = "disk";
+ content = {
+ type = "gpt";
+ partitions = {
+ # 1 MiB BIOS-boot partition required by GRUB on GPT disks
+ boot = {
+ size = "1M";
+ type = "EF02"; # BIOS boot
+ priority = 1;
+ };
+
+ # 512 MiB /boot - keeps kernels/initrds out of root for clarity
+ ESP = {
+ size = "512M";
+ type = "8300";
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/boot";
+ };
+ };
+
+ # Root partition - all remaining space
+ root = {
+ size = "100%";
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/";
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/eurovm/hardware.nix b/hosts/eurovm/hardware.nix
new file mode 100644
index 0000000..50f768c
--- /dev/null
+++ b/hosts/eurovm/hardware.nix
@@ -0,0 +1,32 @@
+{ modulesPath, ... }:
+
+{
+ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
+
+ # Hetzner Cloud uses virtio block devices and a BIOS boot (non-EFI for older
+ # instances; newer CX instances support UEFI - disko.nix uses GPT + BIOS-boot
+ # partition so it works on both).
+ boot.loader.grub = {
+ enable = true;
+ # disko will set boot.loader.grub.device via the disk configuration
+ };
+
+ boot.initrd.availableKernelModules = [
+ "ata_piix"
+ "uhci_hcd"
+ "virtio_pci"
+ "virtio_scsi"
+ "sd_mod"
+ "sr_mod"
+ ];
+
+ boot.kernelModules = [ "kvm-intel" ];
+
+ # Hetzner Cloud networking: single public interface
+ networking = {
+ useDHCP = false;
+ interfaces.eth0.useDHCP = true;
+ # IPv6 is assigned via SLAAC on Hetzner
+ interfaces.eth0.ipv6.addresses = [];
+ };
+}