Current config:
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./modules/env.nix
];
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "560.35.03";
sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg=";
settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk=";
persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
};
# The nvidia-settings build is currently broken due to a missing
# vulkan header; re-enable whenever
# 0384602eac8bc57add3227688ec242667df3ffe3the hits stable.
nvidiaSettings = false;
modesetting.enable = true;
# Power management is required to get nvidia GPUs to behave on
# suspend, due to firmware bugs. Aren't nvidia great?
powerManagement.enable = true;
open = true;
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 5;
# Kernel
#boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_10;
boot.blacklistedKernelModules = [ "amdgpu" ];
boot.kernelParams =
[
"amd_iommu=on"
# slim HD 5450 650M 1GB DDR3
#"vfio-pci.ids=1002:68f9,1002:aa68,"
# thicc HD 4870 1GB DDR5
"vfio-pci.ids=1002:9440,1002:aa30,"
];
boot.kernelModules = [
"vfio_virqfd"
"vfio_pci"
"vfio_iommu_type1"
"vfio"
"nct6775"
];
boot.extraModprobeConfig = "options vfio-pci ids=1002:68f9,1002:aa68";
boot.initrd.kernelModules = [ "nvidia" "nvidia_drm" "nvidia_uvm" "nvidia_modeset" ];
#boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
services.udev.extraRules = ''
# Pen Tablet
SUBSYSTEM=="usb", ATTRS{product}=="XP-Pen Artist 12 (2nd Gen)", ATTRS{idProduct}=="094a", ATTRS{idVendor}=="28bd", MODE="0660", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", GROUP="plugdev"
# Arduino
KERNEL=="ttyUSB*", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", MODE="0666", GROUP="plugdev"
#SUBSYSTEMS=="usb", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", MODE="0666", GROUP="plugdev"
'';
# file system shenanigans
fileSystems."/mnt/Games" =
{
device = "/dev/disk/by-uuid/9226e50e-fc7b-4a95-baac-a59b1d779899";
fsType = "ext4";
options =
[
"users"
"nofail"
"x-gvfs-show"
"exec"
];
label = "Games";
};
fileSystems."/mnt/SeagateBarracuda" =
{
device = "/dev/disk/by-uuid/1b78ca3b-618f-496f-8a6e-d4e575f5d84b";
fsType = "ext4";
options =
[
"users"
"nofail"
"x-gvfs-show"
"exec"
];
label = "Seagate Barracuda";
};
fileSystems."/mnt/HGST" =
{
device = "/dev/disk/by-uuid/a18e9a89-3b84-4bc0-85fc-5828bd1e7342";
fsType = "ext4";
options =
[
"users"
"nofail"
"x-gvfs-show"
"exec"
];
label = "HGST";
};
fileSystems."/mnt/WinVM" =
{
device = "/dev/disk/by-uuid/3199b99a-c2f5-42c7-b41e-11d83b97da4d";
fsType = "ext4";
options =
[
"users"
"x-gvfs-show"
"exec"
];
label = "WinVM";
};
fileSystems."/mnt/smb" = {
device = "//192.168.0.16/nika";
fsType = "cifs";
options = let
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,user,users";
in ["${automount_opts},credentials=/home/nika/.dotfiles/smb-secrets,uid=1000,gid=100"];
};
# fuck nvidia
services.xserver.videoDrivers = ["nvidia"];
# hardware.nvidia = {
# #package = config.boot.kernelPackages.nvidiaPackages.latest;
# open = false;
# #nvidiaSettings = true;
# modesetting.enable = true;
# powerManagement.enable = true;
# };
#
# #hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
# hardware.nvidia = {
# package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "560.35.03";
# sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
# sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
# openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg=";
# settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk=";
# persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
# };
# nvidiaSettings = false;
# };
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;
# Enable Wayland windowing system
# services.displayManager.sddm.wayland.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver = {
xkb.layout = "us";
xkb.variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Bluetooth
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
hardware.opentabletdriver.enable = true;
# turn off the daemon service - it's borked afaik so for now I'll just use autostart until there either there's a fix or I'll fix it
hardware.opentabletdriver.daemon.enable = true;
services.hardware.openrgb.enable = true;
# Create WiFi Hotspot
# services.create_ap = {
# enable = true;
# settings = {
# INTERNET_IFACE = "enp42s0f3u3";
# WIFI_IFACE = "wlo1";
# WPA_VERSION = "3";
# FREQ_BAND = "2.4";
# SSID = "FC-Kiffen";
# PASSPHRASE = "ZA8r2dXB3KddEn";
# };
# };
services.avahi.enable = true;
services.avahi.nssmdns4 = true;
# Enable sound with pipewire.
# hardware.pulseaudio = {
# enable = true;
# extraConfig = "load-module module-equalizer-sink\nload-module module-dbus-protocol";
# };
# security.rtkit.enable = true;
# By default, NixOS uses Pipewire. Below is the default setting
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# extraConfig.pipewire =
# {
# "10-null-sink" = {
# context.objects = [
# { factory = "adapter";
# args = {
# factory.name = "support.null-audio-sink";
# node.name = "my-sink";
# media.class = "Audio/Sink";
# audio.position = [ "FL" "FR" "FC" "LFE" "RL" "RR" ];
# monitor.channel-volumes = true;
# monitor.passthrough = true;
# adapter.auto-port-config = {
# mode = "dsp";
# monitor = true;
# position = "preserve";
# };
# };
# }
# ];
# };
# };
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# TLP Power management
# services.tlp = {
# enable = true;
# settings = {
# CPU_SCALING_GOVERNOR_ON_BAT="performance";
# CPU_SCALING_GOVERNOR_ON_AC="performance";
#
# # 100 is max
# CPU_MAX_PERF_ON_BAT=100;
# CPU_MAX_PERF_ON_AC=100;
# };
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
users.groups.plugdev = {};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.nika = {
isNormalUser = true;
description = "nika";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "wireshark" "openrazer" "scanner" "lp" "plugdev" ];
packages = with pkgs; [
kdePackages.kate
# thunderbird
];
};
services.davfs2.enable = true;
services.samba.enable = true;
#services.monero.enable = true;
# services.xmrig = {
# enable = true;
# settings = {
# autosave = true;
# cpu = true;
# opencl = false;
# cuda = true;
# pools = [
# {
# url = "pool.supportxmr.com:443";
# user = "your-wallet";
# keepalive = true;
# tls = true;
# }
# ];
# };
# };
# Install firefox.
programs.firefox.enable = true;
# Install Steam
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
# install git
programs.git = {
enable = true;
};
programs.wireshark = {
enable = true;
};
programs.coolercontrol.enable = true;
hardware.openrazer.enable = true;
#nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
# "steam"
# "steam-original"
# "steam-run"
#];
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# libvirtdeez nuts AAAAAAAAAAAAaa
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd];
};
vhostUserPackages = [
pkgs.virtiofsd
];
};
};
# Automatically delete generations older than 30 days every week
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# specialisation."VFIO".configuration = {
# system.nixos.tags = [ "with-vfio" ];
# vfio.enable = true;
#};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages =
#let
# nvidiaEnabled = lib.elem "nvidia" config.services.xserver.videoDrivers;
#in
#(
with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
librewolf
lshw
vlc
wineWowPackages.stable
winetricks
gparted
ntfs3g
kdePackages.yakuake
htop
_1password-gui
vencord
spotify
obs-studio
cowsay
kdePackages.kalarm
nextcloud-client
pciutils
exfat
wireshark
exfatprogs
cifs-utils
kdePackages.kdenlive
#glaxnimate
hyfetch
openrazer-daemon
polychromatic
libsForQt5.skanlite
#gnome.simple-scan
openrgb-with-all-plugins
popsicle
#libsForQt5.xp-pen-g430-driver
krita
#libsForQt5.xp-pen-deco-01-v2-driver
tmuxPlugins.open
screen
# linux-wallpaperengine
signal-desktop
monero-gui
qpaeq
xmrig
vesktop
coolercontrol.coolercontrol-gui
coolercontrol.coolercontrol-ui-data
lm_sensors
yt-dlp
arduino
usbutils
audacity
freerdp3
remmina
xclicker
dotnetCorePackages.sdk_8_0_2xx
icu
vscode
qdirstat
kdePackages.kget
#kdePackages.kcolorpicker
#libsForQt5.kcolorpicker
xcolor
kdiskmark
gsmartcontrol
qpwgraph
libreoffice
esptool
kdePackages.korganizer
# QEMU stuff
qemu
virt-manager
virt-viewer
dnsmasq
vde2
bridge-utils
netcat-openbsd
libguestfs
libvirt
];
#)
#++ lib.optionals nvidiaEnabled [
# (config.hardware.nvidia.package.settings.overrideAttrs (oldAttrs: {
# buildInputs = oldAttrs.buildInputs ++ [ pkgs.vulkan-headers ];
# }))
#];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}
Trying 560 driver with overrideAttrs commented out yields:
building the system configuration...
error: builder for '/nix/store/y68lmsz4wwlv6sy4gwkknq3l3n94f4yc-nvidia-settings-560.35.03.drv' failed with exit code 2;
last 10 log lines:
> make[1]: *** [Makefile:381: _out/Linux_x86_64/gtk3/ctkevent.o] Error 1
> In file included from gtk+-2.x/ctkwindow.h:25,
> from gtk+-2.x/ctkwindow.c:34:
> libXNVCtrlAttributes/NvCtrlAttributes.h:24:10: fatal error: vulkan/vulkan.h: No such file or directory
> 24 | #include <vulkan/vulkan.h>
> | ^~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [Makefile:381: _out/Linux_x86_64/gtk3/ctkwindow.o] Error 1
> make[1]: Leaving directory '/build/source/src'
> make: *** [Makefile:23: all] Error 2
For full logs, run 'nix log /nix/store/y68lmsz4wwlv6sy4gwkknq3l3n94f4yc-nvidia-settings-560.35.03.drv'.
error: 1 dependencies of derivation '/nix/store/gii45ixirbr6a3hikvj1fy0xs5q7g5i2-unit-coolercontrold.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/29lv61ns2bbsji3xycj4adkcpgf4vvmj-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/by53vxfb32gja4n26aipipi29bql807s-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x4x3dycz9s268vn6d5l2f4zb7mdvrlvn-nixos-system-nixos-24.05.20241004.6e6b3dd.drv' failed to build