This repository has been archived on 2026-03-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nixos/hosts/gunter/configuration.nix
Torjus Håkestad 9cde18d173
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m26s
gunter: switch to proprietary nvidia driver and load in initrd
The open nvidia driver had significant issues with DP MST displays,
including flip event timeouts and kernel warnings. The proprietary
driver handles MST failures more gracefully. Loading nvidia modules
in initrd eliminates the ~22 second black screen during boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:33:53 +01:00

160 lines
3.9 KiB
Nix

{
config,
lib,
inputs,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
../../system/monitoring
];
# Sops stuff
sops.defaultSopsFile = ../../secrets/gunter/secrets.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
sops.secrets."gotify_tokens/backup-home" = { };
# Enable microcode updates
hardware.enableRedistributableFirmware = true;
# Bootloader stuff
boot = {
blacklistedKernelModules = [
"mt7921e"
"mt7921_common"
"mt792x_lib"
"mt76_connac_lib"
"mt76"
];
# Kernel stuff
kernelPackages = lib.warn "Kernel pinned to 6.18 due to nvidia driver incompatibility with 6.19" pkgs.linuxPackages_6_18;
kernelParams = [ "module_blacklist=amdgpu" ];
kernel.sysctl = {
"vm.max_map_count" = 262144;
};
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
# Bootloader stuff
loader.systemd-boot = {
configurationLimit = 10;
memtest86.enable = true;
};
supportedFilesystems = [ "nfs" ];
initrd.kernelModules = [
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
};
# Networking stuff
networking.hostName = "gunter"; # Define your hostname.
networking.firewall.allowedTCPPorts = [ 8989 ];
# Additional nix caches for homelab and CUDA
nix.settings = {
substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"nix-cache02.home.2rjus.net-1:QyT5FAvJtV+EPQrgQQ6iV9JMg1kRiWuIAJftM35QMls="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
# Enable graphics
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libva-vdpau-driver
nvidia-vaapi-driver
];
};
# Nvidia stuff
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package =
# lib.warn "nvidia driver override to use 580.82.07"
# config.boot.kernelPackages.nvidiaPackages.mkDriver
# {
# version = "580.82.07";
# sha256_64bit = "sha256-Bh5I4R/lUiMglYEdCxzqm3GLolQNYFB0/yJ/zgYoeYw=";
# sha256_aarch64 = lib.fakeHash;
# openSha256 = "sha256-8/7ZrcwBMgrBtxebYtCcH5A51u3lAxXTCY00LElZz08=";
# settingsSha256 = lib.fakeHash;
# persistencedSha256 = lib.fakeSha256;
# };
};
# Setup nvidia video drivers
# nixpkgs.overlays = [
# (self: super: {
# hyprland = super.hyprland.override {
# debug = true;
# };
# })
# ];
services.xserver.videoDrivers = [ "nvidia" ];
# Host capabilities
host.capabilities = {
hasCuda = true;
hasBattery = false;
formFactor = "desktop";
volumeScrollStep = 5;
enableArrhist = true;
hasEduroamAccess = false;
backupRepository = "rest:http://10.69.12.52:8000/gunter.home.2rjus.net";
backupPassword = "gunter.home.2rjus.net";
};
# Install system-wide packages
environment.systemPackages = with pkgs; [
curl
git
libnotify
usbutils
vim
wget
v4l-utils
nmap
pciutils
# X shit
# xorg.xorgserver
# xorg.xinit
# xorg.xf86inputevdev
# xorg.xf86inputlibinput
# xorg.xinit
];
# 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?
}