NOflake/systems/NOlaptop.nix

104 lines
3.3 KiB
Nix
Raw Normal View History

2024-04-04 02:50:30 -07:00
{pkgs, ...}: {
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
2024-04-04 02:50:30 -07:00
nvtopPackages.amd
2023-07-17 16:41:11 -07:00
];
2024-04-04 02:50:30 -07:00
services.power-profiles-daemon.enable = true;
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-04-04 02:50:30 -07:00
# stop using this: https://community.frame.work/t/tracking-ppd-v-tlp-for-amd-ryzen-7040/39423/9?u=ghett_klapson
# 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\\|Preonic\\|Razer\\|Macropad\" /sys/bus/usb/devices/*/product | sed \"s/product/power\\\\/control/\"); do echo on >| '$f'; done'";
# };
# };
2024-03-20 17:29:48 -07:00
2024-03-24 17:08:49 -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-24 17:08:49 -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
2024-03-29 12:51:49 -07:00
services.snapper.configs = {
home = {
SUBVOLUME = "/home";
ALLOW_USERS = ["tao"];
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_HOURLY = "5";
TIMELINE_LIMIT_DAILY = "7";
};
};
services.snapper.snapshotInterval = "*:0/5";
2024-03-18 14:50:43 -07:00
services.xserver.displayManager.defaultSession = "plasma";
services.xserver.displayManager.sddm.wayland.enable = true;
2024-04-01 16:36:43 -07:00
services.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 g+w /sys/class/backlight/%k/brightness"
'';
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"
2024-04-04 02:50:30 -07:00
"amdgpu.abmlevel=1"
2024-03-24 16:39:32 -07:00
];
boot.kernelModules = ["kvm-amd"];
2024-04-04 02:50:30 -07:00
# boot.extraModulePackages = [ ];
2024-03-24 16:39:32 -07:00
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
}