2023-11-22 15:33:16 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
modulesPath,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2023-10-15 17:27:57 -04:00
|
|
|
nixpkgs.hostPlatform = "x86_64-linux";
|
2023-11-22 15:33:16 -05:00
|
|
|
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
2023-06-13 23:34:03 -04:00
|
|
|
|
2023-10-15 17:27:57 -04:00
|
|
|
boot = {
|
2024-01-10 19:07:11 -05:00
|
|
|
kernelPackages = pkgs.linuxPackages_zen;
|
|
|
|
|
2024-05-29 12:29:21 -04:00
|
|
|
kernelParams = [
|
|
|
|
"amd_pstate=active"
|
|
|
|
];
|
|
|
|
kernelModules = ["amdgpu" "kvm-amd" "acpi_call"];
|
|
|
|
|
|
|
|
extraModulePackages = with config.boot.kernelPackages; [
|
|
|
|
acpi_call
|
|
|
|
zenpower
|
|
|
|
];
|
2024-01-10 19:07:11 -05:00
|
|
|
blacklistedKernelModules = ["k10temp"];
|
2023-10-17 18:45:08 -04:00
|
|
|
|
2023-10-15 17:27:57 -04:00
|
|
|
initrd = {
|
2023-11-22 15:33:16 -05:00
|
|
|
availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
|
2023-10-15 17:40:57 -04:00
|
|
|
|
|
|
|
luks.devices."root" = {
|
|
|
|
device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d";
|
|
|
|
};
|
2023-10-15 17:27:57 -04:00
|
|
|
};
|
2023-10-15 17:40:57 -04:00
|
|
|
|
|
|
|
loader = {
|
|
|
|
efi.canTouchEfiVariables = true;
|
2023-10-17 18:45:08 -04:00
|
|
|
|
2024-02-11 12:19:10 -05:00
|
|
|
systemd-boot = {
|
2023-10-15 17:40:57 -04:00
|
|
|
enable = true;
|
2024-02-17 14:52:43 -05:00
|
|
|
consoleMode = "max";
|
2024-02-11 12:19:10 -05:00
|
|
|
configurationLimit = 30;
|
2023-10-15 17:40:57 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/254807#issuecomment-1722351771
|
|
|
|
swraid.enable = false;
|
2023-09-29 23:46:34 -04:00
|
|
|
};
|
2023-06-13 23:34:03 -04:00
|
|
|
|
2023-10-15 17:27:57 -04:00
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-uuid/6ae4d722-dacf-485a-8d29-b276f540dc91";
|
|
|
|
fsType = "btrfs";
|
|
|
|
};
|
2023-06-13 23:34:03 -04:00
|
|
|
|
2023-10-15 17:27:57 -04:00
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/NIXBOOT";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
2023-09-29 23:46:34 -04:00
|
|
|
};
|
2023-06-13 23:34:03 -04:00
|
|
|
|
2024-08-18 23:14:30 -04:00
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/var/lib/swapfile";
|
|
|
|
size = 16 * 1024;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2023-10-15 15:14:42 -04:00
|
|
|
zramSwap.enable = true;
|
2024-08-18 23:14:30 -04:00
|
|
|
|
2023-10-15 17:27:57 -04:00
|
|
|
hardware = {
|
|
|
|
cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;
|
|
|
|
|
|
|
|
uinput.enable = true;
|
2024-01-10 19:07:11 -05:00
|
|
|
sensor.iio.enable = true;
|
|
|
|
|
2024-07-09 18:35:28 -04:00
|
|
|
amdgpu.initrd.enable = true;
|
|
|
|
|
2024-06-21 18:15:19 -04:00
|
|
|
graphics = {
|
2024-01-10 19:07:11 -05:00
|
|
|
enable = true;
|
2024-07-09 18:35:28 -04:00
|
|
|
enable32Bit = true;
|
2024-01-10 19:07:11 -05:00
|
|
|
};
|
2023-10-15 17:27:57 -04:00
|
|
|
|
|
|
|
bluetooth = {
|
|
|
|
enable = true;
|
|
|
|
powerOnBoot = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
libvirtd.enable = true;
|
|
|
|
waydroid.enable = true;
|
|
|
|
};
|
2023-12-04 01:13:24 -05:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
qemu
|
2024-01-10 19:07:11 -05:00
|
|
|
powertop
|
2023-12-04 01:13:24 -05:00
|
|
|
];
|
2023-10-15 17:27:57 -04:00
|
|
|
|
2023-11-10 23:51:50 -05:00
|
|
|
# enable brightness control
|
2023-10-15 17:27:57 -04:00
|
|
|
programs.light.enable = true;
|
2023-10-15 15:14:42 -04:00
|
|
|
|
2023-12-04 01:13:24 -05:00
|
|
|
services = {
|
2024-01-10 19:07:11 -05:00
|
|
|
xserver.videoDrivers = ["modesetting"];
|
2024-08-07 09:52:00 -04:00
|
|
|
|
|
|
|
# https://www.reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/
|
|
|
|
pipewire.wireplumber.extraConfig."10-disable-camera" = {
|
|
|
|
"wireplumber.profiles" = {
|
|
|
|
main = {
|
|
|
|
"monitor.libcamera" = "disabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-10 19:07:11 -05:00
|
|
|
tlp = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
NMI_WATCHDOG = 0;
|
|
|
|
|
|
|
|
RADEON_DPM_PERF_LEVEL_ON_AC = "auto";
|
|
|
|
RADEON_DPM_PERF_LEVEL_ON_BAT = "low";
|
|
|
|
RADEON_DPM_STATE_ON_AC = "performance";
|
|
|
|
RADEON_DPM_STATE_ON_BAT = "battery";
|
|
|
|
|
|
|
|
CPU_BOOST_ON_AC = 1;
|
|
|
|
CPU_BOOST_ON_BAT = 0;
|
|
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
|
|
|
|
|
|
|
CPU_MIN_PERF_ON_AC = 0;
|
|
|
|
CPU_MAX_PERF_ON_AC = 100;
|
|
|
|
CPU_MIN_PERF_ON_BAT = 0;
|
|
|
|
CPU_MAX_PERF_ON_BAT = 20;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
power-profiles-daemon.enable = false;
|
2023-06-13 23:34:03 -04:00
|
|
|
|
2024-01-08 11:25:18 -05:00
|
|
|
udev.extraRules =
|
2024-06-09 22:49:30 -04:00
|
|
|
# udev
|
2024-01-08 11:25:18 -05:00
|
|
|
''
|
|
|
|
# give permanent path to keyboard XF86* binds
|
|
|
|
SUBSYSTEMS=="input", ATTRS{id/product}=="0006", ATTRS{id/vendor}=="0000", SYMLINK += "video-bus"
|
|
|
|
'';
|
2023-12-04 01:13:24 -05:00
|
|
|
};
|
2023-06-13 23:34:03 -04:00
|
|
|
}
|