mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
35 lines
857 B
Nix
35 lines
857 B
Nix
{ config, pkgs, lib, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.aviallon.hardware;
|
|
desktopCfg = config.aviallon.desktop;
|
|
generalCfg = config.aviallon.general;
|
|
in
|
|
{
|
|
options.aviallon.hardware = { };
|
|
|
|
imports = [
|
|
./amd
|
|
./nvidia
|
|
./intel
|
|
./mesa.nix
|
|
];
|
|
|
|
config = {
|
|
|
|
environment.systemPackages = []
|
|
++ optional (cfg.amd.enable && cfg.nvidia.enable) pkgs.nvtop
|
|
++ optional cfg.amd.enable pkgs.nvtop-amd
|
|
++ optional cfg.nvidia.enable pkgs.nvtop-nvidia
|
|
;
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
# Why: https://www.phoronix.com/news/Ryzen-Segv-Response
|
|
# Workaround: https://forums.gentoo.org/viewtopic-p-2605135.html#2605135
|
|
"kernel.randomize_va_space" = mkIf (generalCfg.cpuVendor == "amd" && generalCfg.cpuArch == "znver1" ) (warn "Disable Adress Space Layout Randomization on Ryzen 1 CPU" 0);
|
|
};
|
|
|
|
};
|
|
|
|
}
|