From 91ab0f99028f650602e5bc4f6cc5f4db1a47869b Mon Sep 17 00:00:00 2001 From: hektor Date: Wed, 4 Nov 2026 22:11:04 +0100 Subject: [PATCH] feat(hecuba): switch to UEFI (and modularize) --- hosts/hecuba/default.nix | 67 +++- hosts/hecuba/facter.json | 714 ++++++++++++++++++++++++--------- modules/bootloader/default.nix | 36 +- 3 files changed, 608 insertions(+), 209 deletions(-) diff --git a/hosts/hecuba/default.nix b/hosts/hecuba/default.nix index 7283948..008f29a 100644 --- a/hosts/hecuba/default.nix +++ b/hosts/hecuba/default.nix @@ -1,5 +1,6 @@ { inputs, + lib, pkgs, config, ... @@ -9,6 +10,8 @@ let meta = import ./meta.nix; + bios = config.bootloader.firmware == "bios"; + uefi = config.bootloader.firmware == "uefi"; in { imports = [ @@ -23,6 +26,10 @@ in hardware.facter.reportPath = ./facter.json; + bootloader = { + enable = true; + firmware = "uefi"; + }; docker.enable = true; hardening = { enable = true; @@ -61,22 +68,56 @@ in networking.hostName = config.host.name; - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; + boot.loader.grub.device = lib.mkIf bios "/dev/sda"; + boot.loader.systemd-boot.bootCounting.enable = lib.mkIf uefi true; + + fileSystems = lib.mkIf bios { + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "ext4"; + }; }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/boot"; - fsType = "ext4"; - }; - swapDevices = [ + swapDevices = lib.mkIf bios [ { device = "/dev/disk/by-label/swap"; } ]; - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; + disko.devices.disk.main = lib.mkIf uefi { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + swap = { + size = "4G"; + content.type = "swap"; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; users.users = { root.hashedPassword = "!"; @@ -88,11 +129,7 @@ in security.sudo.wheelNeedsPassword = false; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "-d"; - }; + nix.gc.options = "--delete-older-than 14d"; virtualisation.docker.autoPrune = { enable = true; diff --git a/hosts/hecuba/facter.json b/hosts/hecuba/facter.json index 0eff894..75e85c2 100644 --- a/hosts/hecuba/facter.json +++ b/hosts/hecuba/facter.json @@ -2,9 +2,6 @@ "version": 1, "system": "x86_64-linux", "virtualisation": "kvm", - "uefi": { - "supported": false - }, "hardware": { "bios": { "apm_info": { @@ -18,10 +15,10 @@ "version": 0, "video_memory": 0 }, - "pnp": true, + "pnp": false, "pnp_id": 0, "lba_support": false, - "low_memory_size": 654336, + "low_memory_size": 0, "smbios_version": 768 }, "bridge": [ @@ -75,11 +72,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.7", "sysfs_bus_id": "0000:00:02.7", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167939072, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 7, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 8, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -144,9 +158,10 @@ "sysfs_bus_id": "0000:00:1f.0", "detail": { "function": 0, - "command": 259, + "command": 7, "header_type": 0, "secondary_bus": 0, + "irq": 0, "prog_if": 0 }, "driver": "lpc_ich", @@ -209,11 +224,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.5", "sysfs_bus_id": "0000:00:02.5", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167947264, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 5, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 6, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -276,11 +308,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.3", "sysfs_bus_id": "0000:00:02.3", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167955456, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 3, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 4, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -343,11 +392,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.1", "sysfs_bus_id": "0000:00:02.1", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167963648, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 1, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 2, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -408,9 +474,10 @@ "sysfs_bus_id": "0000:00:00.0", "detail": { "function": 0, - "command": 259, + "command": 7, "header_type": 0, "secondary_bus": 0, + "irq": 0, "prog_if": 0 }, "module_alias": "pci:v00008086d000029C0sv00001AF4sd00001100bc06sc00i00" @@ -465,11 +532,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:03.0", "sysfs_bus_id": "0000:00:03.0", + "resources": [ + { + "type": "irq", + "base": 23, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167934976, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 9, + "irq": 23, "prog_if": 0 }, "driver": "pcieport", @@ -532,11 +616,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.6", "sysfs_bus_id": "0000:00:02.6", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167943168, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 6, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 7, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -599,11 +700,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.4", "sysfs_bus_id": "0000:00:02.4", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167951360, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 4, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 5, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -666,11 +784,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.2", "sysfs_bus_id": "0000:00:02.2", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167959552, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 2, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 3, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -733,11 +868,28 @@ "model": "PCI bridge", "sysfs_id": "/devices/pci0000:00/0000:00:02.0", "sysfs_bus_id": "0000:00:02.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167967744, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 1, "secondary_bus": 1, + "irq": 22, "prog_if": 0 }, "driver": "pcieport", @@ -753,7 +905,7 @@ ], "cdrom": [ { - "index": 35, + "index": 34, "attached_to": 7, "class_list": [ "cdrom", @@ -803,6 +955,13 @@ "sysfs_id": "/class/block/sr0", "sysfs_bus_id": "1:0:0:0", "sysfs_device_link": "/devices/pci0000:00/0000:00:1f.2/ata1/host1/target1:0:0/1:0:0:0", + "unix_device_name": "/dev/sr0", + "unix_device_number": { + "type": 98, + "major": 11, + "minor": 0, + "range": 1 + }, "unix_device_names": [ "/dev/cdrom", "/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00001", @@ -810,7 +969,13 @@ "/dev/disk/by-path/pci-0000:00:1f.2-ata-1.0", "/dev/sr0" ], - "unix_device_name2": "/dev/sg2", + "unix_device_name2": "/dev/sg1", + "unix_device_number2": { + "type": 99, + "major": 21, + "minor": 1, + "range": 1 + }, "driver": "ahci", "driver_module": "ahci", "drivers": [ @@ -826,11 +991,10 @@ "cpu": [ { "architecture": "x86_64", - "vendor_name": "GenuineIntel", - "model_name": "Intel Xeon Processor (Skylake, IBRS, no TSX)", - "family": 6, - "model": 85, - "stepping": 4, + "vendor_name": "AuthenticAMD", + "family": 25, + "model": 17, + "stepping": 0, "features": [ "fpu", "vme", @@ -857,6 +1021,8 @@ "ht", "syscall", "nx", + "mmxext", + "fxsr_opt", "pdpe1gb", "rdtscp", "lm", @@ -864,6 +1030,7 @@ "nopl", "xtopology", "cpuid", + "extd_apicid", "tsc_known_freq", "pni", "pclmulqdq", @@ -876,7 +1043,6 @@ "x2apic", "movbe", "popcnt", - "tsc_deadline_timer", "aes", "xsave", "avx", @@ -884,13 +1050,21 @@ "rdrand", "hypervisor", "lahf_lm", + "cmp_legacy", + "cr8_legacy", "abm", + "sse4a", + "misalignsse", "3dnowprefetch", - "cpuid_fault", - "pti", + "osvw", + "topoext", + "perfctr_core", "ssbd", "ibrs", "ibpb", + "stibp", + "ibrs_enhanced", + "vmmcall", "fsgsbase", "bmi1", "avx2", @@ -903,142 +1077,67 @@ "rdseed", "adx", "smap", + "avx512ifma", + "clflushopt", "clwb", "avx512cd", + "sha_ni", "avx512bw", "avx512vl", "xsaveopt", "xsavec", "xgetbv1", "xsaves", + "avx512_bf16", + "clzero", + "xsaveerptr", + "wbnoinvd", "arat", + "avx512vbmi", + "umip", "pku", "ospke", - "md_clear" + "avx512_vbmi2", + "gfni", + "vaes", + "vpclmulqdq", + "avx512_vnni", + "avx512_bitalg", + "avx512_vpopcntdq", + "la57", + "rdpid", + "fsrm" ], "bugs": [ - "cpu_meltdown", + "sysret_ss_attrs", "spectre_v1", "spectre_v2", "spec_store_bypass", - "l1tf", - "mds", - "swapgs", - "itlb_multihit", - "mmio_stale_data", - "retbleed", - "gds", - "bhi", - "spectre_v2_user", - "its" + "srso", + "ibpb_no_ret" ], - "power_management": [ - "" - ], - "bogo": 4190, - "cache": 16384, + "bogo": 4799.99, + "cache": 1024, "units": 2, - "page_size": 4096, "physical_id": 0, "siblings": 2, "cores": 2, - "fpu": false, - "fpu_exception": false, + "fpu": true, + "fpu_exception": true, "cpuid_level": 13, "write_protect": false, + "tlb_size": 1024, "clflush_size": 64, "cache_alignment": 64, "address_sizes": { "physical": "0x28", - "virtual": "0x30" + "virtual": "0x39" } } ], "disk": [ { - "index": 34, - "attached_to": 30, - "class_list": [ - "disk", - "scsi", - "block_device" - ], - "bus_type": { - "hex": "0084", - "name": "SCSI", - "value": 132 - }, - "slot": { - "bus": 0, - "number": 0 - }, - "base_class": { - "hex": "0106", - "name": "Mass Storage Device", - "value": 262 - }, - "sub_class": { - "hex": "0000", - "name": "Disk", - "value": 0 - }, - "vendor": { - "hex": "0000", - "name": "HC", - "value": 0 - }, - "device": { - "hex": "0000", - "name": "Volume", - "value": 0 - }, - "revision": { - "hex": "0000", - "name": "2.5+", - "value": 0 - }, - "serial": "104431809", - "model": "HC Volume", - "sysfs_id": "/class/block/sdb", - "sysfs_bus_id": "0:0:0:1", - "sysfs_device_link": "/devices/pci0000:00/0000:00:02.5/0000:06:00.0/virtio5/host0/target0:0:0/0:0:0:1", - "unix_device_names": [ - "/dev/disk/by-id/scsi-0HC_Volume_104431809", - "/dev/disk/by-path/pci-0000:06:00.0-scsi-0:0:0:1", - "/dev/disk/by-uuid/0ca2e850-f560-450d-8f05-bcd03079463b", - "/dev/sdb" - ], - "unix_device_name2": "/dev/sg1", - "rom_id": "0x80", - "resources": [ - { - "type": "disk_geo", - "cylinders": 15360, - "heads": 64, - "sectors": 32, - "size": "0x0", - "geo_type": "logical" - }, - { - "type": "size", - "unit": "sectors", - "value_1": 31457280, - "value_2": 512 - } - ], - "driver": "virtio_scsi", - "driver_module": "virtio_scsi", - "drivers": [ - "sd", - "virtio_scsi" - ], - "driver_modules": [ - "sd_mod", - "virtio_scsi" - ] - }, - { - "index": 36, + "index": 35, "attached_to": 30, "class_list": [ "disk", @@ -1083,26 +1182,39 @@ "sysfs_id": "/class/block/sda", "sysfs_bus_id": "0:0:0:0", "sysfs_device_link": "/devices/pci0000:00/0000:00:02.5/0000:06:00.0/virtio5/host0/target0:0:0/0:0:0:0", + "unix_device_name": "/dev/sda", + "unix_device_number": { + "type": 98, + "major": 8, + "minor": 0, + "range": 16 + }, "unix_device_names": [ - "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_107569895", + "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_132574142", "/dev/disk/by-path/pci-0000:06:00.0-scsi-0:0:0:0", "/dev/sda" ], "unix_device_name2": "/dev/sg0", - "rom_id": "0x81", + "unix_device_number2": { + "type": 99, + "major": 21, + "minor": 0, + "range": 1 + }, + "rom_id": "0x80", "resources": [ { "type": "disk_geo", - "cylinders": 39064, - "heads": 64, - "sectors": 32, + "cylinders": 9959, + "heads": 255, + "sectors": 63, "size": "0x0", "geo_type": "logical" }, { "type": "size", "unit": "sectors", - "value_1": 80003072, + "value_1": 160006144, "value_2": 512 } ], @@ -1173,11 +1285,52 @@ "model": "VGA compatible controller", "sysfs_id": "/devices/pci0000:00/0000:00:01.0", "sysfs_bus_id": "0000:00:01.0", + "resources": [ + { + "type": "irq", + "base": 21, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2147483648, + "range": 8388608, + "enabled": true, + "access": "read_only", + "prefetch": "no" + }, + { + "type": "mem", + "base": 2167971840, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 786432, + "range": 131072, + "enabled": false, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 826249576448, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 21, "prog_if": 0 }, "driver": "virtio-pci", @@ -1193,7 +1346,7 @@ ], "hub": [ { - "index": 37, + "index": 36, "attached_to": 11, "class_list": [ "usb", @@ -1215,7 +1368,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.18.33 xhci-hcd", + "name": "Linux 6.14.10 xhci-hcd", "value": 7531 }, "device": { @@ -1225,11 +1378,11 @@ }, "revision": { "hex": "0000", - "name": "6.18", + "name": "6.14", "value": 0 }, "serial": "0000:02:00.0", - "model": "Linux 6.18.33 xhci-hcd xHCI Host Controller", + "model": "Linux 6.14.10 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-0:1.0", "sysfs_bus_id": "1-0:1.0", "resources": [ @@ -1277,10 +1430,10 @@ "driver_modules": [ "usbcore" ], - "module_alias": "usb:v1D6Bp0002d0618dc09dsc00dp01ic09isc00ip00in00" + "module_alias": "usb:v1D6Bp0002d0614dc09dsc00dp01ic09isc00ip00in00" }, { - "index": 39, + "index": 38, "attached_to": 11, "class_list": [ "usb", @@ -1302,7 +1455,7 @@ }, "vendor": { "hex": "1d6b", - "name": "Linux 6.18.33 xhci-hcd", + "name": "Linux 6.14.10 xhci-hcd", "value": 7531 }, "device": { @@ -1312,11 +1465,11 @@ }, "revision": { "hex": "0000", - "name": "6.18", + "name": "6.14", "value": 0 }, "serial": "0000:02:00.0", - "model": "Linux 6.18.33 xhci-hcd xHCI Host Controller", + "model": "Linux 6.14.10 xhci-hcd xHCI Host Controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb2/2-0:1.0", "sysfs_bus_id": "2-0:1.0", "detail": { @@ -1354,7 +1507,7 @@ "driver_modules": [ "usbcore" ], - "module_alias": "usb:v1D6Bp0003d0618dc09dsc00dp03ic09isc00ip00in00" + "module_alias": "usb:v1D6Bp0003d0614dc09dsc00dp03ic09isc00ip00in00" } ], "memory": [ @@ -1376,6 +1529,14 @@ }, "model": "Main Memory", "resources": [ + { + "type": "mem", + "base": 0, + "range": 3993718784, + "enabled": true, + "access": "read_write", + "prefetch": "unknown" + }, { "type": "phys_mem", "range": 4026531840 @@ -1533,8 +1694,8 @@ ], "mouse": [ { - "index": 38, - "attached_to": 37, + "index": 37, + "attached_to": 36, "class_list": [ "mouse", "usb" @@ -1574,10 +1735,23 @@ "model": "QEMU USB Tablet", "sysfs_id": "/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1/1-1:1.0", "sysfs_bus_id": "1-1:1.0", + "unix_device_name": "/dev/input/mice", + "unix_device_number": { + "type": 99, + "major": 13, + "minor": 63, + "range": 1 + }, "unix_device_names": [ "/dev/input/mice" ], "unix_device_name2": "/dev/input/mouse0", + "unix_device_number2": { + "type": 99, + "major": 13, + "minor": 32, + "range": 1 + }, "resources": [ { "type": "baud", @@ -1668,6 +1842,7 @@ "model": "Virtio Ethernet Card 0", "sysfs_id": "/devices/pci0000:00/0000:00:02.0/0000:01:00.0/virtio1", "sysfs_bus_id": "virtio1", + "unix_device_name": "enp1s0", "unix_device_names": [ "enp1s0" ], @@ -1694,7 +1869,30 @@ ], "network_interface": [ { - "index": 50, + "index": 39, + "attached_to": 0, + "class_list": [ + "network_interface" + ], + "base_class": { + "hex": "0107", + "name": "Network Interface", + "value": 263 + }, + "sub_class": { + "hex": "0000", + "name": "Loopback", + "value": 0 + }, + "model": "Loopback network interface", + "sysfs_id": "/class/net/lo", + "unix_device_name": "lo", + "unix_device_names": [ + "lo" + ] + }, + { + "index": 40, "attached_to": 26, "class_list": [ "network_interface" @@ -1712,6 +1910,7 @@ "model": "Ethernet network interface", "sysfs_id": "/class/net/enp1s0", "sysfs_device_link": "/devices/pci0000:00/0000:00:02.0/0000:01:00.0/virtio1", + "unix_device_name": "enp1s0", "unix_device_names": [ "enp1s0" ], @@ -1733,28 +1932,6 @@ "driver_modules": [ "virtio_net" ] - }, - { - "index": 51, - "attached_to": 0, - "class_list": [ - "network_interface" - ], - "base_class": { - "hex": "0107", - "name": "Network Interface", - "value": 263 - }, - "sub_class": { - "hex": "0000", - "name": "Loopback", - "value": 0 - }, - "model": "Loopback network interface", - "sysfs_id": "/class/net/lo", - "unix_device_names": [ - "lo" - ] } ], "pci": [ @@ -1807,11 +1984,36 @@ "model": "Communication controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.2/0000:03:00.0", "sysfs_bus_id": "0000:03:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2164260864, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 826245382144, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 0 }, "driver": "virtio-pci", @@ -1873,11 +2075,44 @@ "model": "Ethernet controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.0/0000:01:00.0", "sysfs_bus_id": "0000:01:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2166358016, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 2166882304, + "range": 524288, + "enabled": false, + "access": "read_only", + "prefetch": "no" + }, + { + "type": "mem", + "base": 826244333568, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 0 }, "driver": "virtio-pci", @@ -1943,17 +2178,24 @@ "resources": [ { "type": "io", - "base": 1792, + "base": 24576, "range": 64, "enabled": true, "access": "read_write" + }, + { + "type": "irq", + "base": 16, + "triggered": 0, + "enabled": true } ], "detail": { "function": 3, - "command": 259, + "command": 3, "header_type": 0, "secondary_bus": 0, + "irq": 16, "prog_if": 0 }, "driver": "i801_smbus", @@ -2014,11 +2256,36 @@ "model": "Unclassified device", "sysfs_id": "/devices/pci0000:00/0000:00:02.4/0000:05:00.0", "sysfs_bus_id": "0000:05:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2163212288, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 826247479296, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 0 }, "driver": "virtio-pci", @@ -2079,11 +2346,28 @@ "model": "Unclassified device", "sysfs_id": "/devices/pci0000:00/0000:00:02.3/0000:04:00.0", "sysfs_bus_id": "0000:04:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 826246430720, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 263, + "command": 7, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 0 }, "driver": "virtio-pci", @@ -2154,17 +2438,32 @@ "resources": [ { "type": "io", - "base": 49216, + "base": 24640, "range": 32, "enabled": true, "access": "read_write" + }, + { + "type": "irq", + "base": 46, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2167930880, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" } ], "detail": { "function": 2, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 46, "prog_if": 1 }, "driver": "ahci", @@ -2226,11 +2525,36 @@ "model": "SCSI storage controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.5/0000:06:00.0", "sysfs_bus_id": "0000:06:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2162163712, + "range": 4096, + "enabled": true, + "access": "read_write", + "prefetch": "no" + }, + { + "type": "mem", + "base": 826248527872, + "range": 16384, + "enabled": true, + "access": "read_only", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 0 }, "driver": "virtio-pci", @@ -2430,6 +2754,7 @@ "value": 0 }, "model": "16550A", + "unix_device_name": "/dev/ttyS0", "unix_device_names": [ "/dev/ttyS0" ], @@ -2440,6 +2765,12 @@ "range": 0, "enabled": true, "access": "read_write" + }, + { + "type": "irq", + "base": 4, + "triggered": 0, + "enabled": true } ] } @@ -2498,11 +2829,28 @@ "model": "USB Controller", "sysfs_id": "/devices/pci0000:00/0000:00:02.1/0000:02:00.0", "sysfs_bus_id": "0000:02:00.0", + "resources": [ + { + "type": "irq", + "base": 22, + "triggered": 0, + "enabled": true + }, + { + "type": "mem", + "base": 2165309440, + "range": 16384, + "enabled": true, + "access": "read_write", + "prefetch": "no" + } + ], "detail": { "function": 0, - "command": 1287, + "command": 1031, "header_type": 0, "secondary_bus": 0, + "irq": 22, "prog_if": 48 }, "driver": "xhci_hcd", @@ -2692,4 +3040,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/bootloader/default.nix b/modules/bootloader/default.nix index 50f5134..eea3285 100644 --- a/modules/bootloader/default.nix +++ b/modules/bootloader/default.nix @@ -1,17 +1,31 @@ { lib, config, ... }: { - options.bootloader.enable = lib.mkOption { - default = false; - type = lib.types.bool; - }; - - config = lib.mkIf config.bootloader.enable { - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; + options.bootloader = { + enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + firmware = lib.mkOption { + default = "uefi"; + type = lib.types.enum [ + "bios" + "uefi" + ]; }; }; + + config = lib.mkIf config.bootloader.enable ( + lib.mkMerge [ + (lib.mkIf (config.bootloader.firmware == "uefi") { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }) + (lib.mkIf (config.bootloader.firmware == "bios") { + boot.loader.grub.enable = true; + }) + ] + ); }