nixos: create 'modules/nixos' folder

Let's consolidate all modules under one path, so that NixOS,
home-manager, and nix-darwin (if I ever end up using it down the line)
would go under the same folder.
This commit is contained in:
Bruno BELANYI 2023-11-09 13:37:46 +00:00
parent b52e56ed08
commit c856933803
74 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
let
cfg = config.my.hardware.firmware;
in
{
options.my.hardware.firmware = with lib; {
enable = my.mkDisableOption "firmware configuration";
cpuFlavor = mkOption {
type = with types; nullOr (enum [ "intel" "amd" ]);
default = null;
example = "intel";
description = "Which kind of CPU to activate micro-code updates";
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
hardware = {
enableRedistributableFirmware = true;
};
}
# Intel CPU
(lib.mkIf (cfg.cpuFlavor == "intel") {
hardware = {
cpu.intel.updateMicrocode = true;
};
})
# AMD CPU
(lib.mkIf (cfg.cpuFlavor == "amd") {
hardware = {
cpu.amd.updateMicrocode = true;
};
})
]);
}