nixconfigs/hosts/framenix/default.nix

94 lines
3.2 KiB
Nix

{ config, lib, pkgs, system, ...}:
let
unstable = config.inputInjection.flake-inputs.nixos-unstable.legacyPackages.${system};
in
{
imports = [
../../common
./hardware-configuration.nix
./storage.nix
./swap.nix
];
networking.hostName = "framenix"; # Define your hostname.
# use newer linux-firmware from unstable
hardware.firmware = lib.mkBefore [ unstable.linux-firmware ];
# override tmpdir for daemon
systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp";
# try newer kernels
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_latest.override {
argsOverride = rec {
src = pkgs.fetchurl {
url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
hash = "sha256-sLypPyMhFhamhQOWDIkzZ5cVrWfoZDb3prJaESD6UU0=";
};
version = "6.8-rc4";
modDirVersion = "6.8.0-rc4";
};
});
# revert some commits that introduced the clourful graphics artefacts flickering,
# at least that's the current working hypothesis in https://gitlab.freedesktop.org/drm/amd/-/issues/3097
boot.kernelPatches = [
{name = "[PATCH] platform/x86/amd/pmf: Fix a suspend hang on Framework 13";
patch = pkgs.fetchpatch {
url = "https://lore.kernel.org/platform-driver-x86/20240217005216.113408-1-mario.limonciello@amd.com/raw";
hash = "sha256-FeKIQ0eLP4yq1WcMaf8Dp0c+DuqOdeuBQU07dFswzD4=";
};
}
{name = "drm/buddy: Fix alloc_range() error handling code";
patch = pkgs.fetchpatch {
url = "https://cgit.freedesktop.org/drm/drm-misc/patch/?id=8746c6c9dfa31d269c65dd52ab42fde0720b7d91";
hash = "sha256-Ir7TDLspbYilTJr6aVVb8urIYI2N2vZwI5ayp7laaGw=";
};
}
];
boot.kernelParams = [
# temporary workaround for white flickering graphics artefacts
"amdgpu.sg_display=0"
# powersave
"amd_pstate=active"
"amdgpu.abmlevel=1" # adaptive backlight management
];
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
hardware.enableRedistributableFirmware = true;
services.fwupd.enable = true;
# I do not need fingerprint reading
services.fprintd.enable = false;
environment.systemPackages = [
pkgs.radeontop
pkgs.framework-tool
];
}