hardware-x86_64: port to modules system
This commit is contained in:
parent
9c60924513
commit
d33d5a4582
|
@ -1,65 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
|
|
||||||
"usb_storage" # rpi needed this to boot from usb storage, i think.
|
|
||||||
# "usbhid" "hid-generic" # hopefully these will fix USB HID auto-sleep ?
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.initrd.supportedFilesystems = [ "ext4" "btrfs" "ext2" "ext3" "vfat" ];
|
|
||||||
# find more of these with sensors-detect
|
|
||||||
boot.kernelModules = [
|
|
||||||
"coretemp"
|
|
||||||
"kvm-intel"
|
|
||||||
"kvm-amd" # desktop
|
|
||||||
"amdgpu" # desktop
|
|
||||||
];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
boot.kernelParams = [ "boot.shell_on_fail" ];
|
|
||||||
boot.consoleLogLevel = 7;
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.systemd-boot.configurationLimit = 40; # keep this many generations
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
# enable cross compilation
|
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
||||||
# nixpkgs.crossSystem.system = "aarch64-linux";
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "powersave";
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
|
||||||
hardware.cpu.amd.updateMicrocode = true; # desktop
|
|
||||||
hardware.cpu.intel.updateMicrocode = true; # laptop
|
|
||||||
services.fwupd.enable = true;
|
|
||||||
# powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS
|
|
||||||
powerManagement.powertop.enable = false;
|
|
||||||
|
|
||||||
hardware.opengl.extraPackages = [
|
|
||||||
# laptop
|
|
||||||
pkgs.intel-compute-runtime
|
|
||||||
pkgs.intel-media-driver # new
|
|
||||||
pkgs.libvdpau-va-gl # new
|
|
||||||
pkgs.vaapiIntel
|
|
||||||
# desktop
|
|
||||||
pkgs.rocm-opencl-icd
|
|
||||||
pkgs.rocm-opencl-runtime
|
|
||||||
];
|
|
||||||
hardware.opengl.driSupport = true;
|
|
||||||
# For 32 bit applications
|
|
||||||
hardware.opengl.driSupport32Bit = true;
|
|
||||||
|
|
||||||
# TODO colin: does this *do* anything?
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# services.snapper.configs = {
|
|
||||||
# root = {
|
|
||||||
# subvolume = "/";
|
|
||||||
# extraConfig = {
|
|
||||||
# ALLOW_USERS = "colin";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# services.snapper.snapshotInterval = "daily";
|
|
||||||
}
|
|
|
@ -2,9 +2,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./../../helpers/universal
|
./../../helpers/universal
|
||||||
./../../helpers/hardware-x86_64.nix
|
|
||||||
# ./../../helpers/gui/gnome.nix
|
|
||||||
#./../../helpers/gui/i3.nix
|
|
||||||
./fs.nix
|
./fs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./../../helpers/universal
|
./../../helpers/universal
|
||||||
./../../helpers/hardware-x86_64.nix
|
|
||||||
# ./../../helpers/gui/gnome.nix
|
|
||||||
./fs.nix
|
./fs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./gui
|
./gui
|
||||||
|
./hardware
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
7
modules/hardware/default.nix
Normal file
7
modules/hardware/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./x86_64.nix
|
||||||
|
];
|
||||||
|
}
|
68
modules/hardware/x86_64.nix
Normal file
68
modules/hardware/x86_64.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
config = mkIf (pkgs.system == "x86_64-linux") {
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
|
||||||
|
"usb_storage" # rpi needed this to boot from usb storage, i think.
|
||||||
|
# "usbhid" "hid-generic" # hopefully these will fix USB HID auto-sleep ?
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.initrd.supportedFilesystems = [ "ext4" "btrfs" "ext2" "ext3" "vfat" ];
|
||||||
|
# find more of these with sensors-detect
|
||||||
|
boot.kernelModules = [
|
||||||
|
"coretemp"
|
||||||
|
"kvm-intel"
|
||||||
|
"kvm-amd" # desktop
|
||||||
|
"amdgpu" # desktop
|
||||||
|
];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelParams = [ "boot.shell_on_fail" ];
|
||||||
|
boot.consoleLogLevel = 7;
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 40; # keep this many generations
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# enable cross compilation
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
# nixpkgs.crossSystem.system = "aarch64-linux";
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = "powersave";
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
hardware.cpu.amd.updateMicrocode = true; # desktop
|
||||||
|
hardware.cpu.intel.updateMicrocode = true; # laptop
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
# powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS
|
||||||
|
powerManagement.powertop.enable = false;
|
||||||
|
|
||||||
|
hardware.opengl.extraPackages = [
|
||||||
|
# laptop
|
||||||
|
pkgs.intel-compute-runtime
|
||||||
|
pkgs.intel-media-driver # new
|
||||||
|
pkgs.libvdpau-va-gl # new
|
||||||
|
pkgs.vaapiIntel
|
||||||
|
# desktop
|
||||||
|
pkgs.rocm-opencl-icd
|
||||||
|
pkgs.rocm-opencl-runtime
|
||||||
|
];
|
||||||
|
hardware.opengl.driSupport = true;
|
||||||
|
# For 32 bit applications
|
||||||
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
|
# TODO colin: does this *do* anything?
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# services.snapper.configs = {
|
||||||
|
# root = {
|
||||||
|
# subvolume = "/";
|
||||||
|
# extraConfig = {
|
||||||
|
# ALLOW_USERS = "colin";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# services.snapper.snapshotInterval = "daily";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user