From a61f2cfe5ef7a3b68cfb6c191268f5b6effb8a9d Mon Sep 17 00:00:00 2001 From: yukkop Date: Fri, 16 Jan 2026 16:16:13 +0000 Subject: [PATCH] feat(nixos): +zombro hardware --- nixos/module/hectic/hardware/zombro.nix | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 nixos/module/hectic/hardware/zombro.nix diff --git a/nixos/module/hectic/hardware/zombro.nix b/nixos/module/hectic/hardware/zombro.nix new file mode 100644 index 0000000..ca54d1a --- /dev/null +++ b/nixos/module/hectic/hardware/zombro.nix @@ -0,0 +1,69 @@ +{ + inputs, + flake, + self, +}: +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.hectic.hardware.zombro; +in { + options.hectic.hardware.zombro = { + enable = lib.mkEnableOption "Enable zombro hardware configurations"; + device = lib.mkOption { + type = lib.types.str; + default = "/dev/vda"; + example = "/dev/disk/by-uuid/f184a16b-6eca-41cb-b48a-ff37cdce1d79"; + description = '' + boot device uuid + if it is null then will use "/dev/vda" + /dev/vda - default zombro device + !! But can changes on reboot if server have volumes + !! So use IDs + ''; + }; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge + [ + { + boot.loader.grub.device = cfg.device; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "xen_blkfront" + ] ++ (if pkgs.system != "aarch64-linux" then [ "vmw_pvscsi" ] else []); + boot.initrd.kernelModules = ["nvme"]; + + disko.devices = { + disk.master = { + device = cfg.device; + content = { + type = "table"; + format = "msdos"; + partitions = [ + { + name = "root"; + part-type = "primary"; + fs-type = "ext4"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + } + (lib.mkIf (pkgs.system == "aarch64-linux") { + boot.initrd.kernelModules = [ "virtio_gpu" ]; + boot.kernelParams = [ "console=tty" ]; + }) + ]); +}