nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.69k stars 1.76k forks source link

Home-manager hyprland module producing a different derivation path than the nixpkgs one #4827

Open SailorSnoW opened 8 months ago

SailorSnoW commented 8 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I'm facing a problem when setting up Hyprland on an Asahi Linux setup.

If I put only programs.hyprland.enable = true in my configuration.nix WITHOUT the home-manager part, it work like a charm, with the asahi GPU enabled and everything.

But if I try to add Hyprland to my home-manager with wayland.windowManager.hyprland.enable = true, then Hyprland is crashing at startup with these logs:

[LOG] Instance Signature: f9c13b614c780c45933440ddecaaa57cc5f1cc12_1703811723
[LOG] Hyprland PID: 25366
[LOG] ===== SYSTEM INFO: =====
[LOG] System name: Linux
[LOG] Node name: snOwOS
[LOG] Release: 6.6.0-asahi
[LOG] Version: #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980

[LOG] GPU information:

[LOG] os-release:
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="24.05.20231224.5f64a12"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 24.05 (Uakari)"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="24.05 (Uakari)"
VERSION_CODENAME=uakari
VERSION_ID="24.05"

[LOG] ========================

[INFO] If you are crashing, or encounter any bugs, please consult https://wiki.hyprland.org/Crashes-and-Bugs/

[LOG] 
Current splash: Stayin' alive, stayin' alive

[LOG] Creating the HookSystem!
[LOG] Creating the KeybindManager!
[LOG] [hookSystem] New hook event registered: configReloaded
[LOG] Creating the AnimationManager!
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 9.67µs. Estimated average calc time: 0.02µs.
[LOG] Creating the ConfigManager!
[LOG] NOTE: further logs to stdout / logfile are disabled by default. Use debug:disable_logs and debug:enable_stdout_logs to override this.
[LOG] Creating the CHyprError!
[LOG] [hookSystem] New hook event registered: focusedMon
[LOG] [hookSystem] New hook event registered: preRender
[LOG] Creating the LayoutManager!
[LOG] [hookSystem] New hook event registered: preConfigReload
[LOG] Reloading the config!
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 6.21µs. Estimated average calc time: 0.03µs.
[LOG] Using config: /home/snow/.config/hypr/hyprland.conf
[LOG] Registered dynamic var "$mod" -> SUPER
[LOG] Disabling stdout logs! Check the log for further logs.
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[render/egl.c:556] Failed to create GBM device
[render/egl.c:572] Failed to initialize EGL context
[render/gles2/renderer.c:682] Could not initialize EGL
[CRITICAL] m_sWLRRenderer was NULL!
[CRITICAL] Critical error thrown: wlr_gles2_renderer_create_with_drm_fd() failed!

So something is definitely messing up with the Asahi GPU in the home-manager module but I can't get what.

Note that programs.hyprland.package and wayland.windowManager.hyprland.package both link to pkgs.hyprland, so I was expecting the same derivation path for both, but that's not the case, it produce two different derivation:

 $ ls /nix/store/winxb879spzf1dxsyf8qyhfk4wbyj7y4-hyprland-0.33.1
bin  share
$ ls /nix/store/55zcn09b2xa5j3c48wiglwk8135rfvma-hyprland-0.33.1
bin  share

If I run Hyprland from the NixOS module derivation path, it work well also.

What could be the difference between the NixOS module and the home-manager module that cause this to happen then ? And how I could deal with that actually if I absolutely want to use home-manager to declaratively produce my Hyprland config ?

Maintainer CC

@fufexan

System information

- system: `"aarch64-linux"`
 - host os: `Linux 6.6.0-asahi, NixOS, 24.05 (Uakari), 24.05.20231219.54aac08`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/etc/nix/path/nixpkgs`
fufexan commented 8 months ago

In my case the packages are the same both before and after applying module-specific configs

`nix repl` output ```nix nix-repl> nixosConfigurations.io.config.programs.hyprland.finalPackage «derivation /nix/store/jvfi75fjwl7fi6mgf00gq4krqrp65q6l-hyprland-0.33.1+date=2023-12-27_e5eb11a.drv» nix-repl> nixosConfigurations.io.config.home-manager.users.mihai.wayland.windowManager.hyprland.finalPackage «derivation /nix/store/jvfi75fjwl7fi6mgf00gq4krqrp65q6l-hyprland-0.33.1+date=2023-12-27_e5eb11a.drv» nix-repl> nixosConfigurations.io.config.home-manager.users.mihai.wayland.windowManager.hyprland.package «derivation /nix/store/jvfi75fjwl7fi6mgf00gq4krqrp65q6l-hyprland-0.33.1+date=2023-12-27_e5eb11a.drv» nix-repl> nixosConfigurations.io.config.programs.hyprland.package «derivation /nix/store/jvfi75fjwl7fi6mgf00gq4krqrp65q6l-hyprland-0.33.1+date=2023-12-27_e5eb11a.drv» ```

Can you provide more info about your config? Are you using flakes/channels?

SailorSnoW commented 8 months ago

Oh so I think something is missing with my config maybe.

Here is the up-to-date config that I’ve used when writing this issue:

https://github.com/SailorSnoW/snOwOS

fufexan commented 8 months ago

At a glance your config looks alright, so I don't know what would cause the discrepancy.

rycee commented 8 months ago

The system configuration seems to include some overlays that are not included in the HM configuration. Perhaps that has something to do with the difference?

You could also try something like nix-diff. No guarantee it will be helpful but it might say something that helps pin-point the difference between the packages.

stale[bot] commented 5 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.