nix/nixos/hosts/framework16/default.nix

96 lines
3.1 KiB
Nix

{ hostname, inputs, config, lib, pkgs, modulesPath, username, ... }: {
imports = [
( import ../../common/services/syncthing/pictures.nix { path = "/home/${username}/Pictures/RAW"; })
inputs.nixos-hardware.nixosModules.framework-16-7040-amd
(modulesPath + "/installer/scan/not-detected.nix")
./disks.nix
# ./vm-gpu.nix
../../common/services/tailscale-autoconnect.nix
../../common/modules/secureboot.nix
../../common/modules/udev-rules.nix
../../common/services/fwupd.nix
../../common/modules/builder.nix
../../common/services/podman.nix
../../common/services/geoclue.nix
../../common/services/ollama.nix
../../common/services/forgejo-runner.nix
../../common/services/syncthing/default.nix
];
nixpkgs.config.rocmSupport = true;
# https://wiki.nixos.org/wiki/Ollama
services.ollama = {
package = pkgs.ollama-rocm;
acceleration = "rocm";
rocmOverrideGfx = "11.0.2";
environmentVariables.HCC_AMDGPU_TARGET = "gfx1102";
};
# NOTE: One of these commented entries is causing stuttering issues.
# Now that I commented them all out my laptop is performing great. I might just leave it...
# boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "uas" "sd_mod" ];
# boot.initrd.kernelModules = [ ];
# boot.kernelModules = [ "kvm-amd" ];
# boot.extraModulePackages = [ ];
# boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
boot.kernelPackages = pkgs.linuxPackages_latest;
# Real Time
# boot.kernelPackages = pkgs.linuxPackages-rt_latest;
boot.kernelParams = [
"usbcore.autosuspend=-1" # Disable USB autosuspend
"pcie_aspm=off" # Disable ASPM for PCIe devices
"amd_iommu=on" # Force IOMMU for better device isolation
"boot.shell_on_fail"
"amdgpu.abmlevel=0" # Prevents screen washout on power-save modes
];
networking.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
networking.hostName = hostname;
hardware = {
keyboard.zsa.enable = true;
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
graphics.enable = true;
amdgpu.opencl.enable = true;
};
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
# apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
environment.systemPackages = with pkgs; [
inputs.deploy-rs.packages.${system}.deploy-rs
framework-tool
element-desktop
# WINE
wineWowPackages.stable
winetricks
wineWowPackages.waylandFull
nvtopPackages.amd
# RGB stuff
openrgb-with-all-plugins
rivalcfg
# Other
distrobox
];
}