_hardware-configuration.nix (1445B)
1 # modules/hosts/generic/_hardware-configuration.nix — REPLACE THIS FILE with 2 # your machine's own, generated by the installer: 3 # 4 # nixos-generate-config --root /mnt --show-hardware-configuration \ 5 # > modules/hosts/generic/_hardware-configuration.nix 6 # 7 # (on an already-installed NixOS: drop `--root /mnt`, or copy 8 # /etc/nixos/hardware-configuration.nix here.) 9 # 10 # What is below is only a placeholder so the flake evaluates before you have 11 # done that: it assumes the partitions are labelled `nixos` (root, ext4) and 12 # `boot` (the EFI system partition; BIOS installs have none), which is what 13 # docs/install.md creates. Follow that guide exactly and this file also works 14 # unchanged — but a generated one is always the safer choice. 15 { lib, modulesPath, settings, ... }: 16 { 17 imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 18 19 boot.initrd.availableKernelModules = [ 20 # Bare metal: NVMe, SATA, USB. VMs: virtio, VMware, Hyper-V, VirtualBox. 21 "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sr_mod" 22 "virtio_pci" "virtio_blk" "virtio_scsi" "vmw_pvscsi" "hv_storvsc" 23 ]; 24 25 fileSystems."/" = { 26 device = "/dev/disk/by-label/nixos"; 27 fsType = "ext4"; 28 }; 29 30 fileSystems."/boot" = lib.mkIf (settings.boot == "efi") { 31 device = "/dev/disk/by-label/boot"; 32 fsType = "vfat"; 33 options = [ "fmask=0077" "dmask=0077" ]; 34 }; 35 36 swapDevices = [ ]; 37 38 networking.useDHCP = lib.mkDefault true; 39 }