moving towards modules...

This commit is contained in:
Gerg-L 2023-02-20 22:28:01 -05:00
parent 32bf78aa36
commit f911f3f44d
18 changed files with 288 additions and 237 deletions

59
modules/hardware.nix Normal file
View file

@ -0,0 +1,59 @@
_: {
config,
options,
...
}: let
cfg = config.localModules.hardware;
in {
options.localModules.hardware = {
gpuAcceleration = {
disable = mkOption {
type = types.bool;
default = false;
};
};
sound = {
disable = mkOption {
type = types.bool;
default = false;
};
};
};
config =
mkMerge [
(
mkIf (! cfg.gpuAcceleration.disable) {
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
}
)
(mkIf (! cfg.sound.disable) {
security.rtkit.enable = true;
sound.enable = lib.mkForce false; #disable alsa
hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio
services.pipewire = {
enable = true;
audio.enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
})
]
++ {
hardware = {
cpu = {
intel.updateMicrocode = true;
amd.updateMicrocode = true;
enableRedistributableFirmware = true;
};
};
};
}