diff --git a/machines/default.nix b/machines/default.nix index ee7bba8..9d68089 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -62,4 +62,9 @@ in targetHost = "shinobu.home.sbruder.de"; }; + nazuna = { + system = "x86_64-linux"; + + targetHost = "nazuna.sbruder.de"; + }; } diff --git a/machines/nazuna/README.md b/machines/nazuna/README.md new file mode 100644 index 0000000..3f7801a --- /dev/null +++ b/machines/nazuna/README.md @@ -0,0 +1,13 @@ +# renge + +## Hardware + +[Hetzner Cloud](https://hetzner.com/cloud) CPX21 (3 AMD EPYC vCPU, 4 GB RAM, 80 GB SSD). + +## Purpose + +It will host most services that do not require large storage and benefit from high availability. + +## Name + +Renge Miyauchi is a character from *Non Non Biyori* diff --git a/machines/nazuna/configuration.nix b/machines/nazuna/configuration.nix new file mode 100644 index 0000000..7b64020 --- /dev/null +++ b/machines/nazuna/configuration.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + + networking.hostName = "nazuna"; + + system.stateVersion = "23.05"; +} diff --git a/machines/nazuna/hardware-configuration.nix b/machines/nazuna/hardware-configuration.nix new file mode 100644 index 0000000..3477293 --- /dev/null +++ b/machines/nazuna/hardware-configuration.nix @@ -0,0 +1,61 @@ +{ lib, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot = { + kernelParams = [ "ip=86.106.183.111/26::86.106.183.65::nazuna" ]; + initrd = { + availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + kernelModules = [ "dm-snapshot" ]; + network.enable = true; # remote unlocking + luks.devices."root".device = "/dev/disk/by-uuid/b20be409-adb6-47fc-ba9b-c07e61503070"; + }; + loader = { + grub.enable = false; + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/05b0918e-3c24-45bf-950e-4af9d89d3be2"; + fsType = "btrfs"; + options = [ "compress=zstd" ]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/0CBC-D947"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + { + device = "/dev/disk/by-uuid/00bb36bf-18c0-401c-afe4-3c9b944add9d"; + randomEncryption.enable = true; + } + ]; + + networking = { + useDHCP = false; + usePredictableInterfaceNames = false; + }; + systemd.network = { + enable = true; + networks = { + eth0 = { + name = "eth0"; + DHCP = "yes"; + domains = [ "sbruder.de" ]; + address = [ "86.106.183.111/26" "2a0d:f302:123:8d61::1/64" ]; + gateway = [ "86.106.183.65" "2a0d:f302:123::1" ]; + }; + }; + }; + + # no smart on qemu disk + services.smartd.enable = false; +} diff --git a/modules/ssh.nix b/modules/ssh.nix index 612846f..2c2f4ea 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -67,5 +67,9 @@ hostNames = [ "shinobu" "shinobu.home.sbruder.de" "shinobu.vpn.sbruder.de" ]; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJJNZPT2Mmys2nw/ovX6Z1Cb4WDAaWBWanycNwF9IEjl"; }; + nazuna-initrd = { + hostNames = [ "[nazuna.sbruder.de]:2222" ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN/VDiagTEI5BIjTrPRkGWAH3YurcMEV8i6Q8PSnxlg3 nazuna"; + }; }; }