Skip to content

Commit

Permalink
Solve crash issues with Hyprland on Ubuntu 22 & 24
Browse files Browse the repository at this point in the history
For the last couple of months I have not been able to start Hyprland due
to instant crash related to the graphics drivers or some form of
mismatch with OpenGL drivers. I managed to solve it by downgrading NixGL
and Hyprland to stable branch of nixpkgs (NixOS 24.11).
  • Loading branch information
AntonFriberg committed Jan 6, 2025
1 parent 920dcd9 commit c605371
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
29 changes: 20 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixGL = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
Expand All @@ -31,18 +32,28 @@
hyprpanel,
nix-index-database,
nixGL,
nixpkgs-stable,
nixpkgs,
...
}: {
}: let
system = "x86_64-linux";
pkgsConfig = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
pkgs = import nixpkgs {
inherit system;
config = pkgsConfig;
};
pkgs-stable = import nixpkgs-stable {
inherit system;
config = pkgsConfig;
};
in {
homeConfigurations."antonfr" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-stable;
inherit nixGL;
inherit firefox-addons;
inherit hyprpanel;
Expand Down
3 changes: 2 additions & 1 deletion modules/gui/hyprland.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
pkgs,
pkgs-stable,
config,
hyprpanel,
...
Expand All @@ -8,7 +9,7 @@

wayland.windowManager.hyprland = {
enable = true;
package = config.lib.nixGL.wrap pkgs.hyprland;
package = config.lib.nixGL.wrap pkgs-stable.hyprland;

systemd.enable = true;
xwayland.enable = true;
Expand Down
3 changes: 2 additions & 1 deletion modules/gui/nixgl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
nixGL = {
packages = nixGL.packages; # you must set this or everything will be a noop
defaultWrapper = "mesa"; # choose from options
vulkan.enable = true;
installScripts = ["mesa"];
vulkan.enable = false;
};
}

0 comments on commit c605371

Please sign in to comment.