mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
hardware: make imports cleaner
This commit is contained in:
parent
346db9e7df
commit
6aed492cc0
1 changed files with 18 additions and 19 deletions
|
@ -1,32 +1,31 @@
|
||||||
{ config, pkgs, lib, modulesPath, ... }:
|
{ config, lib, modulesPath, ... }:
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs) callPackage;
|
hardwareFor = name: cfg:
|
||||||
|
lib.mkIf
|
||||||
hardwareFor = name: cfg: lib.mkIf (config.sconfig.hardware == name) cfg;
|
(config.sconfig.hardware == name)
|
||||||
|
(lib.mkMerge cfg);
|
||||||
|
|
||||||
hardwareModules =
|
hardwareModules =
|
||||||
[
|
[
|
||||||
(hardwareFor "qemu"
|
(hardwareFor "qemu"
|
||||||
{
|
[
|
||||||
inherit (callPackage "${modulesPath}/profiles/qemu-guest.nix" { }) boot;
|
(import "${modulesPath}/profiles/qemu-guest.nix" { })
|
||||||
services.qemuGuest.enable = true;
|
{ services.qemuGuest.enable = true; }
|
||||||
})
|
])
|
||||||
|
|
||||||
(hardwareFor "vmware"
|
(hardwareFor "vmware"
|
||||||
{
|
[
|
||||||
virtualisation.vmware.guest.enable = true;
|
{ virtualisation.vmware.guest.enable = true; }
|
||||||
boot.initrd.availableKernelModules = [ "mptspi" ];
|
{ boot.initrd.availableKernelModules = [ "mptspi" ]; }
|
||||||
})
|
])
|
||||||
|
|
||||||
(hardwareFor "physical"
|
(hardwareFor "physical"
|
||||||
{
|
[
|
||||||
hardware.cpu.amd.updateMicrocode = true;
|
(import "${modulesPath}/installer/scan/not-detected.nix" { inherit lib; })
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
{ hardware.cpu.amd.updateMicrocode = true; }
|
||||||
|
{ hardware.cpu.intel.updateMicrocode = true; }
|
||||||
# <nixpkgs>/nixos/modules/installer/scan/not-detected.nix
|
])
|
||||||
hardware.enableRedistributableFirmware = true;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue