diff --git a/hosts/nishimiya.nix b/hosts/nishimiya.nix index c38ea9c..e39af5f 100644 --- a/hosts/nishimiya.nix +++ b/hosts/nishimiya.nix @@ -1,6 +1,10 @@ { config, lib, pkgs, ... }: { + imports = with inputs.nixos-hardware.nixosModules; [ + common-cpu-intel common-pc-ssd + ]; + fileSystems = { "/" = { device = "/dev/disk/by-uuid/d06b511d-1970-421d-b006-231a7af91942"; @@ -14,7 +18,9 @@ swapDevices = [ ]; # TODO boot = { initrd = { - availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" + # NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/common/pc/laptop/acpi_call.nix + "acpi_call" ]; kernelModules = [ "dm-snapshot" ]; luks.devices = { cryptroot = { @@ -25,6 +31,8 @@ }; kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; + # NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/e495/default.nix#L12 + kernelParams = [ "acpi_backlight=native" ]; }; ptw = { @@ -97,9 +105,6 @@ primaryInterface = "wlp5s0"; }; virtualisation.enable = true; - hardware = { - intel.enable = true; - }; }; services = { diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix deleted file mode 100644 index 3c35b81..0000000 --- a/modules/hardware/amd.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, ... }: - -let - cfg = config.ptw.hardware.amdcpu; -in { - options.ptw.hardware.amdcpu = { - enable = lib.mkEnableOption "Enable support for AMD CPUs"; - }; - - config = lib.mkIf cfg.enable { - hardware.cpu.amd.updateMicrocode = true; - }; -} diff --git a/modules/hardware/amdgpu.nix b/modules/hardware/amdgpu.nix deleted file mode 100644 index de80da8..0000000 --- a/modules/hardware/amdgpu.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, lib, pkgs, ... -}: - -let - cfg = config.ptw.hardware.amdgpu; -in { - options.ptw.hardware.amdgpu = { - enable = lib.mkEnableOption "Enable support for AMDGPU GPUs"; - }; - - config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - unstable.mesa - unstable.firmwareLinuxNonfree - ]; - services.xserver.videoDrivers = [ "amdgpu" ]; - }; -} diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix deleted file mode 100644 index 7195240..0000000 --- a/modules/hardware/intel.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.ptw.hardware.intel; -in { - options.ptw.hardware.intel = { - enable = lib.mkEnableOption "Enable support for Intel CPUs"; - }; - - config = lib.mkIf cfg.enable { - hardware = { - cpu.intel.updateMicrocode = true; - # NOTE: Assuming each Intel CPU has integrated graphics - opengl.extraPackages = with pkgs; [ vaapiIntel intel-media-driver ]; - }; - # TODO: Remove? - services.xserver.videoDrivers = [ "modesetting" "fbdev" ]; - }; -}