nixos/systems/framework.nix
2026-02-15 22:46:17 -08:00

65 lines
1.7 KiB
Nix
Executable file

{ config, lib, pkgs, modulesPath, ... }: {
networking.hostName = "framework";
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/primary";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/ESP";
fsType = "vfat";
};
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ]; # Include kvm-amd for virtualization support
boot.extraModulePackages = [];
boot.kernelParams = [
"mem_sleep_default=s2idle"
];
services.power-profiles-daemon.enable = true;
services.tlp.enable = false;
services.thermald.enable = false; # thermald is for Intel, not AMD
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
swapDevices = [
{
device = "/swapfile";
size = 102400;
priority = 0;
}
];
systemd.tmpfiles.rules = [
"f /swapfile 0600 root root - -"
];
# Brightness control
hardware.acpilight.enable = lib.mkDefault true;
# SSD optimization
services.fstrim.enable = lib.mkDefault true;
# Logind lid-switch configuration
services.logind = {
settings = {
Login = {
HandleLidSwitch = "suspend-then-hibernate";
HandleLidSwitchDocked = "ignore"; # Prevent suspend when connected to a dock
HandleLidSwitchExternalPower = "ignore";
HandlePowerKey = "poweroff";
HandleSuspendKey = "ignore"; # Optional: configure behavior for the suspend key
};
};
};
environment.systemPackages = with pkgs; [
via
radeontop
];
}