nixos/machines/Marid/hardware-configuration.nix

82 lines
2 KiB
Nix
Raw Normal View History

2021-11-25 22:03:04 +01:00
{ config, pkgs, modulesPath, ... }:
let
cfg = config.machine;
in {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
loader.systemd-boot = {
enable = true;
};
loader.efi.canTouchEfiVariables = true;
2023-04-16 18:29:48 +02:00
tmp = {
useTmpfs = true;
cleanOnBoot= true;
};
2021-11-25 22:03:04 +01:00
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
kernelModules = [ "kvm-amd" ];
kernelParams = [
# get backlight service to work part one (fixes systemd backlight service)
"acpi_backlight=native"
];
kernel.sysctl = {
"kernel.nmi_watchdog" = 0;
"fs.inotify.max_user_watches" = 524288;
"vm.dirty_writeback_centisecs" = 1500;
};
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cf8db7d5-5da7-4fb9-818d-ed5dd2815f0d";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/96E4-9DF3";
fsType = "vfat";
};
hardware = {
firmware = with pkgs; [ firmwareLinuxNonfree ];
enableAllFirmware = true;
ksm.enable = true;
opengl = {
driSupport = true;
driSupport32Bit = true;
};
pulseaudio = {
enable = true;
support32Bit = true;
package = pkgs.pulseaudioFull;
zeroconf.discovery.enable = false;
extraClientConf = ''
autospawn = no
'';
};
bluetooth = {
enable = true;
powerOnBoot = true;
};
};
powerManagement = {
enable = true;
cpuFreqGovernor = "powersave";
};
services = {
upower.enable = true;
# Fix Backlight Part 2 (allows acpilight to modify brightness)
udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod 664 /sys/class/backlight/%k/brightness"
'';
};
time.timeZone = "Europe/Berlin";
}