I’m not so long on NixOS, for a long time I studied it on a virtual machine where everything was fine, today I decided to switch to this system, but after setting nvidia I don’t run most of the programs, I opened the console via ctrl+alt+f2 and looked there journalctl where it was written for example for blackbox:
blackbox-wrapp[2648]: Error 71 (Protocol error) dispatching to Wayland display.
Here are my configs:
configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "ru_RU.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.displayManager.gdm.wayland = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
users.users.inari = {
isNormalUser = true;
description = "Maxim";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.fish;
};
programs.fish.enable = true;
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
home-manager
zed-editor
blackbox-terminal
nixd
nautilus
nautilus-open-in-blackbox
heroic
gnome-tweaks
protonup
zen-browser
gnomeExtensions.dash-to-dock
gnomeExtensions.blur-my-shell
gnomeExtensions.appindicator
gnomeExtensions.vitals
gnomeExtensions.gsconnect
gnomeExtensions.clipboard-indicator
gnomeExtensions.rounded-window-corners-reborn
];
programs.steam.enable = true;
programs.steam.gamescopeSession.enable = true;
programs.gamemode.enable = true;
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/inari/.steam/root/compatibilitytools.d";
};
nixpkgs.config.packageOverrides = pkgs: {
zen-browser = pkgs.callPackage ./nonNixPackages/zen-browser/default.nix { };
};
fonts.packages = with pkgs; [
jetbrains-mono
];
services.gnome.core-utilities.enable = false;
environment.gnome.excludePackages = [ pkgs.gnome-tour ];
services.xserver.excludePackages = [ pkgs.xterm ];
services.xserver.desktopManager.xterm.enable = false;
documentation.nixos.enable = false;
programs.nano.enable = false;
system.stateVersion = "24.05"; # Did you read the comment?
}
hardware-configuration
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "uas" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/78657e37-f633-480f-9ff6-1172f749eacc";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/AA5A-6F14";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/f294c9c7-b577-4ec6-9bad-e6b7111773d6"; }
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.open = false;
hardware.nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
}