mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Hardware] Move hardware.nix in hardware/default.nix
This commit is contained in:
parent
789d36717e
commit
537b23cd39
2 changed files with 9 additions and 4 deletions
37
hardware/default.nix
Normal file
37
hardware/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ 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
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"armv7l-linux"
|
||||
];
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue