From a30f8b19a68b35977b09206326bc6d5b3333642d Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Sat, 23 Nov 2024 09:42:19 -0500 Subject: [PATCH] hestia: init --- hosts/hestia/default.nix | 13 +++++++ hosts/hestia/disks.nix | 46 +++++++++++++++++++++++++ hosts/hestia/hardware-configuration.nix | 17 +++++++++ secrets/secrets.nix | 1 + 4 files changed, 77 insertions(+) create mode 100644 hosts/hestia/default.nix create mode 100644 hosts/hestia/disks.nix create mode 100644 hosts/hestia/hardware-configuration.nix diff --git a/hosts/hestia/default.nix b/hosts/hestia/default.nix new file mode 100644 index 0000000..0deafe5 --- /dev/null +++ b/hosts/hestia/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ./hardware-configuration.nix + ./disks.nix + ]; + + system.stateVersion = "25.05"; + networking.hostId = "85eb2d89"; # "hestia" in base64->hex + + modules.hardware.form.server = true; + boot.loader.timeout = 1; +} diff --git a/hosts/hestia/disks.nix b/hosts/hestia/disks.nix new file mode 100644 index 0000000..80ba583 --- /dev/null +++ b/hosts/hestia/disks.nix @@ -0,0 +1,46 @@ +{ pkgs, lib, ... }: +with lib.our.disko; +{ + boot.kernelPackages = pkgs.linuxPackages; + + boot.zfs.extraPools = [ "tank" ]; + + disko.devices = { + nodev."/" = mkTmpfs "2G"; + disk = { + hdd1 = mkDisk "wwn-0x5000c50015bda593" { + partitions = { + boot = mkESP "64M" "/boot/efi"; + store = mkBtrfsPartEndAt "238400M" "/media/store" { + # 1/4th of 1000GB/931.5GiB + subvolumes = mkBtrfsSubvols { + "/boot" = { }; + "/etc/ssh" = { }; + "/persist" = { }; + "/nix" = { }; + }; + }; + zfs = mkZPart "100%" "tank"; + }; + }; + hdd2 = mkZDisk "wwn-0x5000cca215d2481a" "tank"; + hdd3 = mkZDisk "wwn-0x5000cca215d24629" "tank"; + }; + + zpool = mkZPools { + tank = { + datasets = { + storage = mkZfs "/storage" { }; + backups = mkZfs "/backups" { }; + }; + }; + }; + }; + + fileSystems = markNeededForBoot [ + "/persist" + "/storage" + "/etc/ssh" + "/home" + ]; +} diff --git a/hosts/hestia/hardware-configuration.nix b/hosts/hestia/hardware-configuration.nix new file mode 100644 index 0000000..4540756 --- /dev/null +++ b/hosts/hestia/hardware-configuration.nix @@ -0,0 +1,17 @@ +{ lib, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + boot.kernelParams = [ "boot.shell_on_fail" ]; + boot.supportedFilesystems = [ "btrfs" "zfs" ]; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + info.model = "Dell R330"; +} diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 55c317e..80ec1a2 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -15,6 +15,7 @@ let Infini-SD = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO8oViHNz64NG51uyll/q/hrSGwoHRgvYI3luD/IWTUT root@Infini-SD"; Infini-DL360 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPjmvE76BcPwZSjeNGzlguDQC67Yxa3uyOf5ZmVDWNys root@Infini-DL360"; Infini-RASPBERRY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIwPqTFCztLbYFFUej42hRzzCBzG6BCZIb7zXi2cxeJp root@Infini-RASPBERRY"; + hestia = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIUMLnWIbl6WNZxm22uyDv5mM27hPCn8u8ZZ8EpF+O/3 root@hestia"; }; users = { infinidoge = import ../users/infinidoge/ssh-keys.nix;