Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: hyprland does not start on nvidia systems #9

Open
FegrusB opened this issue Jun 11, 2024 · 4 comments
Open

bug: hyprland does not start on nvidia systems #9

FegrusB opened this issue Jun 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@FegrusB
Copy link

FegrusB commented Jun 11, 2024

I am trying to install using the install script. It seems to work well, but upon finishing hyprland opens fine, but then is totally unresponsive. No key combinations are doing anything. Trying to look into this myself, but I'm very new to nix, and it's difficult with nothing opening! Also, the timezone is incorrect, and doesn't match the one I set in the config nano, could that be related? Thanks for the setup, looks great, if I can get it working!

@FegrusB
Copy link
Author

FegrusB commented Jun 11, 2024

I've gone back to a fresh install, and now am having new problems. The script ran, with a fair few warnings about changed commands. Now I've got a login screen, but once I log in the system fails to load. I'm not running a VM, but I'm guessing the issue is my Nvidia card, though I do also have an intel IGPU. Giving fixing it ago, but there is still an issue.

@librephoenix
Copy link
Owner

It would definitely be the Nvidia card. I don't have any Nvidia hardware so I never bothered to include the relevant config.

The autoinstall script should generate a hardware-configuration.nix for your hardware (Nvidia), but in order for Hyprland to work with Nvidia I think you need to add extra to the Hyprland config (for my config this would be in user/wm/hyprland/hyprland.nix.

This wiki page is probably your friend in this instance: https://wiki.hyprland.org/Nvidia/ but I've never tried any of this so unfortunately I don't know.

@librephoenix
Copy link
Owner

I'll keep this issue open for now since it would probably be possible to add that configuration in conditionally if the config detects an Nvidia card. I'll probably do that once I get a system with an Nvidia card in it :)

@librephoenix librephoenix changed the title Opening unresponsive. bug: hyprland does not start on nvidia systems Jun 29, 2024
@librephoenix librephoenix added the bug Something isn't working label Jun 29, 2024
@wowvain-dev
Copy link

wowvain-dev commented Oct 22, 2024

I don't have your exact configuration but these are the relevant lines that make my nvidia card work on hyprland (my solution assumes you have a similar flake based config to how emmet has it set up. Otherwise, just copying all the contents inside the curly brackets to your configuration.nix should do):

graphics.nix:

 {... }:

{
  hardware = {
    nvidia = {
      nvidiaSettings = true;
      open = true;
      modesetting.enable = true;
    };
  };
}

wayland.nix

{ config, pkgs, ... }:

{
  imports = [
    ./pipewire.nix
    ./dbus.nix
    ./gnome-keyring.nix
    ./fonts.nix
  ];

  environment.systemPackages = with pkgs; [
    wayland 
    waydroid
    (sddm-chili-theme.override {
      themeConfig = {
        blur = true;
        ScreenWidth = 2560;
        ScreenHeight = 1440;
        recursiveBlurLoops = 3;
        recursiveBlurRadius = 5;
      };
    })
  ];

  services.xserver = {
    enable = true;
    videoDrivers = [ "nvidia" "modesetting" ];
    xkb = {
      layout = "us";
      variant = "";
      options = "eurosign:e,caps:escape";
    };
  };

  environment.sessionVariables = {
		WLR_DRM_DEVICES = "/dev/dri/card1";
                WLR_NO_HARDWARE_CURSORS = "1";
                NIXOS_OZONE_WL = "1";
  };
}

hyprland.nix

{ inputs, pkgs, pkgs-unstable, lib, userSettings, ... }:
let
  pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in 
{
  # Wayland configs
  imports = [
    ./wayland.nix
    ./pipewire.nix
    ./dbus.nix
  ];

  # Security
  security = {
    pam.services.login.enableGnomeKeyring = true;
  };

  services.gnome.gnome-keyring.enable = true;

  programs = {
    hyprland = {
      enable = true;
    
      xwayland = {
        enable = true;
      };
      portalPackage = pkgs-hyprland.xdg-desktop-portal-hyprland;
    };
  };

  services.xserver.excludePackages = [ pkgs.xterm ];

  services.xserver = {
    displayManager = {
      gdm = {
        enable = true;
        wayland = true;
      };
    };
  };
}

Be careful about the WLR_DRM_DEVICES env variable. First use

udevadm info -a -n /dev/dri/card0 | grep DRIVER

to figure out what your correct GPU path is, and then set it to which one you want. The current option works on my system but it can easily differ for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants