nixos/machines/Marid/hardware-configuration.nix

93 lines
2 KiB
Nix
Raw Normal View History

2023-09-11 20:23:04 +02:00
{
config,
pkgs,
modulesPath,
...
}:
let
2021-11-25 22:03:04 +01:00
cfg = config.machine;
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
2021-11-25 22:03:04 +01:00
boot = {
loader.systemd-boot = {
enable = true;
};
loader.efi.canTouchEfiVariables = true;
2023-04-16 18:29:48 +02:00
tmp = {
useTmpfs = true;
2023-09-11 20:23:04 +02:00
cleanOnBoot = true;
2023-04-16 18:29:48 +02:00
};
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" ];
2021-11-25 22:03:04 +01:00
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;
};
};
2023-09-11 20:23:04 +02:00
fileSystems."/" = {
device = "/dev/disk/by-uuid/cf8db7d5-5da7-4fb9-818d-ed5dd2815f0d";
fsType = "ext4";
};
2021-11-25 22:03:04 +01:00
2023-09-11 20:23:04 +02:00
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/96E4-9DF3";
fsType = "vfat";
};
2021-11-25 22:03:04 +01:00
hardware = {
firmware = with pkgs; [ firmwareLinuxNonfree ];
2021-11-25 22:03:04 +01:00
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";
}