NOflake/systems/NOlaptop.nix

112 lines
3.1 KiB
Nix
Raw Normal View History

2024-04-12 13:18:23 -07:00
{
2024-04-29 16:25:28 -07:00
lib,
2024-04-12 13:18:23 -07:00
config,
pkgs,
...
}: {
2024-04-20 18:47:52 -07:00
# nixpkgs.overlays = [
# (final: prev: {
# libinput = prev.libinput.overrideAttrs (old: {
# patches =
# (old.patches or [])
# ++ [
# ../extras/libinput-delay.patch
# ];
# });
# })
# ];
2024-04-19 00:07:50 -07:00
2023-07-17 16:41:11 -07:00
environment.systemPackages = with pkgs; [
2024-07-20 19:57:50 -07:00
fw-ectool
2024-04-09 10:51:12 -07:00
framework-tool
2024-04-04 02:50:30 -07:00
nvtopPackages.amd
2023-07-17 16:41:11 -07:00
];
2024-03-18 14:50:43 -07:00
services.fwupd.enable = true;
2024-04-25 15:48:29 -07:00
services.tailscale.useRoutingFeatures = "client";
2024-04-22 12:38:23 -07:00
systemd.services."backlight@backlight:amdgpu_bl2".enable = false;
2024-03-24 17:08:49 -07:00
environment.etc = {
"libinput/local-overrides.quirks".text = "
2024-06-10 17:41:44 -07:00
# MatchUdevType=touchpad
# MatchDMIModalias=dmi:*svnFramework:pnLaptop*
# AttrEventCode=-BTN_RIGHT
2024-03-20 17:29:48 -07:00
2024-06-10 17:41:44 -07:00
[Framework Laptop 16 Keyboard Module]
MatchName=Framework Laptop 16 Keyboard Module*
# MatchUdevType=keyboard
# MatchDMIModalias=dmi:*svnFramework:pnLaptop16*
AttrKeyboardIntegration=internal";
2024-03-24 17:08:49 -07:00
};
2024-03-20 17:29:48 -07:00
2024-04-25 15:48:29 -07:00
nix.buildMachines = [
{
hostName = "nocomputer";
systems = ["x86_64-linux" "i686-linux"];
2024-07-17 15:25:57 -07:00
supportedFeatures = [
"benchmark"
"big-parallel"
"gccarch-znver4"
"kvm"
"nixos-test"
];
2024-04-25 15:48:29 -07:00
}
];
nix.extraOptions = ''
builders-use-substitutes = true
'';
nix.distributedBuilds = 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"
# prevent kb and mouse from waking laptop
ACTION=="add", SUBSYSTEM=="usb", KERNEL=="1-3.2", ATTR{power/wakeup}="disabled"
ACTION=="add", SUBSYSTEM=="usb", KERNEL=="1-4.2", ATTR{power/wakeup}="disabled"
2024-04-01 16:36:43 -07:00
'';
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 = [
2024-04-04 02:50:30 -07:00
"amdgpu.abmlevel=1"
2024-03-24 16:39:32 -07:00
];
boot.kernelModules = ["kvm-amd"];
2024-06-10 17:41:44 -07:00
# boot.extraModulePackages = with config.boot.kernelPackages; [
# framework-laptop-kmod
# ];
2024-03-24 16:39:32 -07:00
powerManagement.cpuFreqGovernor = "powersave";
2024-07-17 15:25:57 -07:00
systemd.sleep.extraConfig = "HibernateDelaySec=360m";
2024-03-24 16:39:32 -07:00
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
}