nix-community / home-manager

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

bug: Alacritty crashing after migrating config #4378

Open Azeved00 opened 1 year ago

Azeved00 commented 1 year ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I was migrating my Alacritty configuration to home manager, this is the result:

programs.alacritty = {
            enable = true;
            settings = {
                window = {
                    padding.x = 10;
                    padding.y = 5;
                    opacity   = 1.0;
                    class.instance = "Alacritty";
                    class.general  = "Alacritty";
                };

                scrolling = {
                    history = 10000;
                    multiplier = 3;
                };

                font.size = 13.0;

                colors = {
                    primary = {
                        background = "0x262626";
                        foreground = "0xEBEBEB";
                    };
                    cursor = {
                        text    ="0xEBEBEB";
                        cursor  ="0xEBEBEB";
                    };
                    normal = {
                        black   ="0x0d0d0d";
                        red     ="0xFF301B";
                        green   ="0xA0E521";
                        yellow  ="0xFFC620";
                        blue    ="0x1BA6FA";
                        magenta ="0x8763B8";
                        cyan    ="0x21DEEF";
                        white   ="0xEBEBEB";
                    };
                    bright = {
                        black   ="0x6D7070";
                        red     ="0xFF4352";
                        green   ="0xB8E466";
                        yellow  ="0xFFD750";
                        blue    ="0x1BA6FA";
                        magenta ="0xA578EA";
                        cyan    ="0x73FBF1";
                        white   ="0xFEFEF8";
                    };
                };

                cursor = {
                    style = "Beam";
                    blinking = "On";
                    blink_interval = 750;
                };

                draw_bold_text_with_bright_colors = true;
                live_config_reload = true;
                working_directory = "~";
            };
        };
After rebuilding the system, i could not initialize alacritty. After running `alacritty -vvv`from a previously opened terminal i got the following output:
Created log file at "/tmp/Alacritty-47690.log"
[0.000004819s] [INFO ] [alacritty] Welcome to Alacritty
[0.000083809s] [INFO ] [alacritty] Version 0.12.0
[0.000092539s] [INFO ] [alacritty] Running on X11
[0.000745477s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/azevedo/.config/alacritty/alacritty.yml"
[0.003676749s] [INFO ] [alacritty] Using GLX 1.4
[0.042688205s] [INFO ] [alacritty] Window scale factor: 1.0833333333333333
[0.043631260s] [DEBUG] [alacritty] Loading "monospace" font
[0.050738360s] [TRACE] [crossfont] Number of fonts is 22
[0.050776493s] [TRACE] [crossfont] Got font path="/home/azevedo/.local/share/fonts/DejaVuSansMono.ttf", index=0
[0.050867704s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Book, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.051604381s] [TRACE] [crossfont] Number of fonts is 24
[0.051623448s] [TRACE] [crossfont] Got font path="/home/azevedo/.local/share/fonts/DejaVuSansMono-Bold.ttf", index=0
[0.051679948s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.052466351s] [TRACE] [crossfont] Number of fonts is 25
[0.052485977s] [TRACE] [crossfont] Got font path="/home/azevedo/.local/share/fonts/DejaVuSansMono-Oblique.ttf", index=0
[0.052545620s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Oblique, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.053335725s] [TRACE] [crossfont] Number of fonts is 30
[0.053355350s] [TRACE] [crossfont] Got font path="/home/azevedo/.local/share/fonts/DejaVuSansMono-BoldOblique.ttf", index=0
[0.053415972s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Oblique, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.056954576s] [INFO ] [alacritty] Running on AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.47)
[0.056970848s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.062658931s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.071977737s] [INFO ] [alacritty] Cell size: 11 x 23
[0.072037869s] [INFO ] [alacritty] Padding: 10 x 5
[0.072050161s] [INFO ] [alacritty] Width: 800, Height: 600
[0.089129284s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 235, g: 235, b: 235 } to Rgb { r: 155, g: 155, b: 155 }
[0.089156941s] [TRACE] [alacritty] Deriving dim colors from normal colors
[0.089167906s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 13, g: 13, b: 13 } to Rgb { r: 8, g: 8, b: 8 }
[0.089179220s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 255, g: 48, b: 27 } to Rgb { r: 168, g: 31, b: 17 }
[0.089190325s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 160, g: 229, b: 33 } to Rgb { r: 105, g: 151, b: 21 }
[0.089200242s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 255, g: 198, b: 32 } to Rgb { r: 168, g: 130, b: 21 }
[0.089210718s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 27, g: 166, b: 250 } to Rgb { r: 17, g: 109, b: 165 }
[0.089220356s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 135, g: 99, b: 184 } to Rgb { r: 89, g: 65, b: 121 }
[0.089231251s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 33, g: 222, b: 239 } to Rgb { r: 21, g: 146, b: 157 }
[0.089241728s] [TRACE] [alacritty_terminal] Scaling RGB by 0.66 from Rgb { r: 235, g: 235, b: 235 } to Rgb { r: 155, g: 155, b: 155 }
[0.089253740s] [INFO ] [alacritty] PTY dimensions: 25 x 70
Error: Failed to spawn command '/run/current-system/sw/bin/bash': No such file or directory (os error 2)
[0.102171632s] [ERROR] [winit] X11 error: XError {
                                   description: "BadWindow (invalid Window parameter)",
                                   error_code: 3,
                                   request_code: 3,
                                   minor_code: 0,
                               }
[0.102361039s] [ERROR] [winit] X11 error: XError {
                                   description: "BadWindow (invalid Window parameter)",
                                   error_code: 3,
                                   request_code: 3,
                                   minor_code: 0,
                               }
[0.102734825s] [INFO ] [alacritty] Goodbye
Deleted log file at "/tmp/Alacritty-47690.log"
Error: "Event loop terminated with code: 1

Messing around with the configuration i discovered that if the line working_directory = "~"; was commented then the alacritty would work without an issue.

Why is this error happening?

Maintainer CC

@emilazy

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.47, NixOS, 23.05 (Stoat), 23.05.3023.74e5bdc5478e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - channels(azevedo): `"nixos-23.05"`
 - channels(root): `"home-manager-23.05.tar.gz, nixos-23.05, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
stale[bot] commented 9 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.