split/rename options, bundle vendor settings

This commit is contained in:
Vinzenz Schroeter 2023-09-24 10:46:15 +02:00
parent 1b7989336e
commit 3a9a7242fc
18 changed files with 109 additions and 54 deletions

View 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;
};
}

View 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
];
};
}

View file

@ -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 {

View 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;
};
}

View file

@ -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;
};
}

View file

@ -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;
};
}