Parameterise cpu config

This commit is contained in:
Simon Bruder 2020-12-05 16:00:34 +01:00
parent 76bd3a4bc8
commit 73021c1a94
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
5 changed files with 17 additions and 3 deletions

View file

@ -4,13 +4,13 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/cpu/intel.nix
../../modules ../../modules
../../profiles/dev.nix ../../profiles/dev.nix
../../users/simon ../../users/simon
]; ];
sbruder = { sbruder = {
cpu.intel.enable = true;
gpu.intel.enable = true; gpu.intel.enable = true;
gui.enable = true; gui.enable = true;
libvirt.enable = true; libvirt.enable = true;

View file

@ -4,13 +4,13 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/cpu/intel.nix
../../modules ../../modules
../../profiles/dev.nix ../../profiles/dev.nix
../../users/simon ../../users/simon
]; ];
sbruder = { sbruder = {
cpu.intel.enable = true;
gpu.amd.enable = true; gpu.amd.enable = true;
gui.enable = true; gui.enable = true;
libvirt.enable = true; libvirt.enable = true;

5
modules/cpu/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./intel.nix
];
}

View file

@ -1,3 +1,11 @@
{ config, lib, ... }:
let
cfg = config.sbruder.cpu.intel;
in
{ {
hardware.cpu.intel.updateMicrocode = true; options.sbruder.cpu.intel.enable = lib.mkEnableOption "intel cpu configuration";
config = lib.mkIf cfg.enable {
hardware.cpu.intel.updateMicrocode = true;
};
} }

View file

@ -10,6 +10,7 @@
# configuration options # configuration options
imports = [ imports = [
./communication.nix ./communication.nix
./cpu
./creative.nix ./creative.nix
./cups.nix ./cups.nix
./docker.nix ./docker.nix