From e98a91883f0dd6e7daf98d7f06c07269ed8071ea Mon Sep 17 00:00:00 2001 From: sajenim Date: Thu, 6 Apr 2023 09:33:49 +0800 Subject: [PATCH] update hardware-configuration.nix --- nixos/hardware-configuration.nix | 47 +++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index dd00939..9872d20 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,10 +1,43 @@ # This is just an example, you should generate yours with nixos-generate-config and put it in here. -{ - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; +{ config, lib, pkgs, modulesPath, ... }: - # Set your system kind (needed for flakes) - nixpkgs.hostPlatform = "x86_64-linux"; +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4698c618-908f-4e50-aee2-bc35e6bdedf9"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/35A6-4C27"; + fsType = "vfat"; + }; + + fileSystems."/drive/3548fbc6-6efd-4ed1-acc1-bd3ffed9d7a7" = + { device = "/dev/disk/by-uuid/3548fbc6-6efd-4ed1-acc1-bd3ffed9d7a7"; + fsType = "ext4"; + }; + + fileSystems."/drive/a20b9780-ddcf-414c-bea0-7e003fea4750" = + { device = "/dev/disk/by-uuid/a20b9780-ddcf-414c-bea0-7e003fea4750"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp34s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }