mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
moving towards modules...
This commit is contained in:
parent
32bf78aa36
commit
f911f3f44d
18 changed files with 288 additions and 237 deletions
59
modules/hardware.nix
Normal file
59
modules/hardware.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue