2024-03-24 16:39:32 -07:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
config,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
amdgpu-kernel-module = pkgs.callPackage ./vrr_patch.nix {
|
|
|
|
|
kernel = config.boot.kernelPackages.kernel;
|
|
|
|
|
};
|
|
|
|
|
in {
|
2023-07-17 16:41:11 -07:00
|
|
|
environment.systemPackages = with pkgs; [
|
2023-11-01 18:58:21 -07:00
|
|
|
# prescurve
|
2024-03-20 17:29:48 -07:00
|
|
|
libinput
|
2023-09-28 23:33:56 -07:00
|
|
|
powertop
|
2024-01-30 09:32:08 -08:00
|
|
|
fw-ectool
|
2023-07-17 16:41:11 -07:00
|
|
|
];
|
|
|
|
|
|
2024-03-18 14:50:43 -07:00
|
|
|
services.fwupd.enable = true;
|
|
|
|
|
services.fprintd.enable = true;
|
2023-07-18 11:12:40 -07:00
|
|
|
|
2024-03-20 17:29:48 -07:00
|
|
|
powerManagement.powertop.enable = false;
|
|
|
|
|
systemd.services.powertop = {
|
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
|
after = ["multi-user.target"];
|
|
|
|
|
path = [pkgs.kmod];
|
|
|
|
|
serviceConfig = {
|
|
|
|
|
Type = "oneshot";
|
|
|
|
|
RemainAfterExit = "yes";
|
|
|
|
|
ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
|
|
|
|
|
ExecStartPost = "
|
|
|
|
|
/bin/sh -c 'for f in $(grep -l 'Keyboard' /sys/bus/usb/devices/*/product | sed \"s/product\\\\power/control/\"); do echo on >| '$f'; done'
|
|
|
|
|
";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-20 17:29:48 -07:00
|
|
|
# environment.etc = {
|
|
|
|
|
# "libinput/local-overrides.quirks".text = "
|
|
|
|
|
# # MatchUdevType=touchpad
|
|
|
|
|
# # MatchDMIModalias=dmi:*svnFramework:pnLaptop*
|
|
|
|
|
# # AttrEventCode=-BTN_RIGHT
|
2024-03-20 17:29:48 -07:00
|
|
|
|
2024-03-20 17:29:48 -07:00
|
|
|
# [Framework Laptop 16 Keyboard Module]
|
|
|
|
|
# MatchName=Framework Laptop 16 Keyboard Module*
|
|
|
|
|
# MatchUdevType=keyboard
|
|
|
|
|
# # MatchDMIModalias=dmi:*svnFramework:pnLaptop16*
|
|
|
|
|
# AttrKeyboardIntegration=internal
|
|
|
|
|
# ";
|
|
|
|
|
# };
|
2024-03-20 17:29:48 -07:00
|
|
|
# services.xserver.libinput = {
|
|
|
|
|
# enable = true;
|
2024-03-20 17:29:48 -07:00
|
|
|
# touchpad.disableWhileTyping = true;
|
2024-03-20 17:29:48 -07:00
|
|
|
# };
|
|
|
|
|
|
2024-03-18 14:50:43 -07:00
|
|
|
services.xserver.displayManager.defaultSession = "plasma";
|
|
|
|
|
services.xserver.displayManager.sddm.wayland.enable = true;
|
|
|
|
|
|
2024-03-24 16:39:32 -07:00
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
boot.initrd.availableKernelModules = [
|
|
|
|
|
"nvme"
|
|
|
|
|
"sd_mod"
|
|
|
|
|
"thunderbolt"
|
|
|
|
|
"usb_storage"
|
|
|
|
|
"xhci_pci"
|
|
|
|
|
"usbhid"
|
|
|
|
|
"uas"
|
|
|
|
|
];
|
|
|
|
|
boot.kernelParams = [
|
|
|
|
|
# "mem_sleep_default=deep"
|
|
|
|
|
# "nvme.noacpi=1"
|
|
|
|
|
];
|
|
|
|
|
boot.kernelModules = ["kvm-amd"];
|
|
|
|
|
boot.extraModulePackages = [
|
|
|
|
|
(amdgpu-kernel-module.overrideAttrs (_: {
|
|
|
|
|
patches = [
|
|
|
|
|
(pkgs.fetchurl {
|
|
|
|
|
url = "https://gitlab.freedesktop.org/agd5f/linux/-/commit/2f14c0c8cae8e9e3b603a3f91909baba66540027.diff";
|
|
|
|
|
hash = "sha256-0++twr9t4AkJXZfj0aHGMVDuOhxtLP/q2d4FGfggnww=";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
}))
|
|
|
|
|
];
|
|
|
|
|
powerManagement.cpuFreqGovernor = "powersave";
|
|
|
|
|
systemd.sleep.extraConfig = "HibernateDelaySec=180m";
|
|
|
|
|
|
2024-03-19 18:12:55 -07:00
|
|
|
fileSystems."/home/tao/games" = {
|
|
|
|
|
device = "/dev/disk/by-uuid/d97a81dc-669c-41d1-912b-829f88fd6f69";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = ["subvol=/home/tao/games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" "discard=async"];
|
|
|
|
|
};
|
2024-03-18 14:50:43 -07:00
|
|
|
fileSystems."/home" = {
|
2024-03-19 18:12:55 -07:00
|
|
|
device = "/dev/disk/by-uuid/d97a81dc-669c-41d1-912b-829f88fd6f69";
|
2024-03-18 14:50:43 -07:00
|
|
|
fsType = "btrfs";
|
2024-03-18 22:45:19 -07:00
|
|
|
options = ["subvol=home" "noatime" "compress-force=zstd:3" "discard=async"];
|
2024-03-18 14:50:43 -07:00
|
|
|
};
|
|
|
|
|
fileSystems."/" = {
|
2024-03-19 18:12:55 -07:00
|
|
|
device = "/dev/disk/by-uuid/d97a81dc-669c-41d1-912b-829f88fd6f69";
|
2024-03-18 14:50:43 -07:00
|
|
|
fsType = "btrfs";
|
2024-03-19 18:12:55 -07:00
|
|
|
options = ["noatime" "compress-force=zstd:3" "discard=async"];
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/boot" = {
|
|
|
|
|
device = "/dev/disk/by-uuid/8E28-E53F";
|
|
|
|
|
fsType = "vfat";
|
2024-03-18 14:50:43 -07:00
|
|
|
};
|
2024-03-18 22:45:19 -07:00
|
|
|
swapDevices = [{device = "/dev/disk/by-uuid/36216521-db46-4bb0-8994-38a36d5c4528";}];
|
2024-03-18 14:50:43 -07:00
|
|
|
|
2023-07-17 16:41:11 -07:00
|
|
|
networking.hostName = "NOlaptop";
|
2023-07-11 00:38:39 -07:00
|
|
|
}
|