split/rename options, bundle vendor settings
This commit is contained in:
parent
1b7989336e
commit
3a9a7242fc
18 changed files with 109 additions and 54 deletions
15
modules/hardware/amdcpu.nix
Normal file
15
modules/hardware/amdcpu.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
isEnabled = config.my.hardware.isAmdCpu;
|
||||
in {
|
||||
options.my.hardware.isAmdCpu = lib.mkEnableOption "amd cpu";
|
||||
|
||||
config = lib.mkIf isEnabled {
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
};
|
||||
}
|
16
modules/hardware/amdgpu.nix
Normal file
16
modules/hardware/amdgpu.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
isEnabled = config.my.hardware.isAmdGpu;
|
||||
in {
|
||||
options.my.hardware.isAmdGpu = lib.mkEnableOption "amd gpu";
|
||||
|
||||
config = lib.mkIf isEnabled {
|
||||
environment.systemPackages = with pkgs; [
|
||||
radeontop
|
||||
];
|
||||
};
|
||||
}
|
|
@ -9,6 +9,9 @@ in {
|
|||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
(builtins.toString ./. + "/${hostName}.nix")
|
||||
./common-desktop.nix
|
||||
./amdcpu.nix
|
||||
./amdgpu.nix
|
||||
./intelcpu.nix
|
||||
];
|
||||
|
||||
options.my.modulesCfg.hostName = lib.mkOption {
|
||||
|
|
14
modules/hardware/intelcpu.nix
Normal file
14
modules/hardware/intelcpu.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
isEnabled = config.my.hardware.isIntelCpu;
|
||||
in {
|
||||
options.my.hardware.isIntelCpu = lib.mkEnableOption "intel cpu";
|
||||
|
||||
config = lib.mkIf isEnabled {
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
};
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
{...}: {
|
||||
config = {
|
||||
my.hardware.enableCommonDesktopSettings = true;
|
||||
my.hardware = {
|
||||
enableCommonDesktopSettings = true;
|
||||
isIntelCpu = true;
|
||||
isAmdGpu = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
|
||||
initrd.kernelModules = [];
|
||||
kernelModules = ["kvm-intel"];
|
||||
extraModulePackages = [];
|
||||
loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
|
||||
|
@ -26,7 +27,5 @@
|
|||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";}
|
||||
];
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
{...}: {
|
||||
config = {
|
||||
my.hardware.enableCommonDesktopSettings = true;
|
||||
my.hardware = {
|
||||
enableCommonDesktopSettings = true;
|
||||
isAmdCpu = true;
|
||||
isAmdGpu = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage"
|
||||
initrd.kernelModules = [];
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
loader.efi.efiSysMountPoint = "/boot";
|
||||
};
|
||||
|
||||
|
@ -49,7 +50,5 @@
|
|||
};
|
||||
|
||||
swapDevices = [];
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue