NixOS / nixos-hardware

A collection of NixOS modules covering hardware quirks.
Creative Commons Zero v1.0 Universal
1.98k stars 613 forks source link

Fails to install `<nixos-hardware/asus/zephyrus/ga402x/nvidia>` on GA402XY when running on `boot.kernelPackages = pkgs.linuxPackages_lqx` #1063

Closed caniko closed 2 months ago

caniko commented 2 months ago

The header speaks for itself.

I get this error when running either nixos-rebuilt boot or switch:

subprocess.CalledProcessError: Command '['/nix/store/gafgm1kn3sgl2nq79ihsb6jdv39s81pr-nix-2.18.5/bin/nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system', '--option', 'build-users-group', '']' died with <Signals.SIGSEGV: 11>.
warning: error(s) occurred while switching to the new configuration

I have to revert to the previous build to build new builds after this error. Very annoying 😆

My config:

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, lib, ... }:

{
  imports =
    [ 
      # Activate only ONE:
      #<nixos-hardware/asus/zephyrus/ga402x/nvidia>
      #<nixos-hardware/asus/zephyrus/ga402x/amdgpu>

      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.kernelPackages = pkgs.linuxPackages_lqx;

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nomad"; # Define your hostname.
  hardware.bluetooth.enable = true;

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Oslo";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  nix.settings.experimental-features = [ "nix-command" ];

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver = {
    layout = "us";
    xkbVariant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # 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;
    # 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;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.can = {
    isNormalUser = true;
    description = "can";
    extraGroups = [ "networkmanager" "wheel" "docker" ];
    packages = with pkgs; [
      kdePackages.kate
    #  thunderbird
    ];
  };

  hardware.nvidia = {
    prime = {
      amdgpuBusId = lib.mkForce "PCI:65:00:0";
    };
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
    linuxKernel.kernels.linux_lqx

    pciutils
    btop

    kubectl
    kubectx
    minikube
    kind
    k9s

    goxlr-utility
    pyenv
    poetry
    black
    ruff
    isort

    git
    wget

    vim
    jetbrains.pycharm-professional
    vscodium-fhs
  ];

  environment.variables.EDITOR = "vim";

  services.goxlr-utility.enable = true;

  virtualisation.docker.enable = true;

  # 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?

}

When I don't have linux_lqd installed the installation succeeds, but the build fails to boot, and I am taken to tty1. When trying to kde-start I am told that no candidate was found, the list of candidates comes up (you know how it is)... Will create a separate issue for this later.

GA402XY has an RTX 4090 in addition to the iGPU, hope we can get this working.

Mic92 commented 2 months ago

I don't think this is a bug in nixos-hardware but in nix-env itself. It looks like this error comes from the systemd-boot builder:

subprocess.CalledProcessError: Command '['/nix/store/gafgm1kn3sgl2nq79ihsb6jdv39s81pr-nix-2.18.5/bin/nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system', '--option', 'build-users-group', '']' died with <Signals.SIGSEGV: 11>.

Can you run it in isolation and see if you have more error output from nix-env? Do a nixos-rebuild test instead to only update /nix/varnix/profiles/system without installing any bootloader.

caniko commented 2 months ago

This was in isolation, and it wasn't working. NixOS just doesn't play nice with anything other than the LTS kernel... I would say that this part of the issue is out of scope for your efforts. Very thankful for that, by the way!

When I don't have linux_lqd installed the installation succeeds, but the build fails to boot, and I am taken to tty1. When trying to kde-start I am told that no candidate was found, the list of candidates comes up (you know how it is)... Will create a separate issue for this later.

I fixed this, the issue was my KDE configuration: It was still in X11, fixed after switching to Wayland.