i3 在尝试登录时崩溃进入 gdm

i3 在尝试登录时崩溃进入 gdm

所以我以前在 ubuntu 上使用过 i3,所以我知道基础知识以及如何更改桌面/窗口管理器。我最近才换到尼克索斯并尝试通过configuration.nix.Configuration.nix安装 i3

# 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, ... }:

{
    imports =
    [ # Include the results of the hardware scan.
        ./hardware-configuration.nix
    ];

    # Bootloader.
    boot.loader.grub.enable = true;
    boot.loader.grub.device = "/dev/sda";
    boot.loader.grub.useOSProber = true;

    networking.hostName = "nixos"; # Define your hostname.

    networking.networkmanager.enable = true;

    # Select internationalisation properties.
    i18n.defaultLocale = "en_IN.utf8";

    # Enable the X11 windowing system.
    # services.xserver.enable = true;

    # Enable the GNOME Desktop Environment.
    # services.xserver.displayManager.gdm.enable = true;
    # services.xserver.desktopManager.gnome.enable = true;
    # services.xserver.windowManager.dwm.enable = true;
    services = {
        xserver = {
            enable = true;
            displayManager = {
                gdm.enable = true;
            };

            desktopManager.gnome.enable = true;
            windowManager.i3.enable = true;
        };

    };

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

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

    # Enable sound with pipewire.
    sound.enable = true;
    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.nrdybhu1 = {
        isNormalUser = true;
        description = "nrdybhu1";
        extraGroups = [ "networkmanager" "wheel" ];
    };

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

    environment.pathsToLink = [ "/libexec" ];

    # List packages installed in system profile. To search, run:
    # $ nix search wget
    environment.systemPackages = with pkgs; [
        # general
        wget
        curl
        silver-searcher
        tmux
        
        # other
        libreoffice
        wine
        git
        aria
        zathura

        file
        gnumake
        gawk
        openssl
        gcc
        gnugrep
        gnupatch
        gnused
        gnutar
        python310
        python310Packages.pip
        fish
        ulauncher

        # window manager
        i3
        i3status
        i3blocks
        i3lock-color
        dmenu
        termite
        neofetch
        feh
        mpv
        ffmpeg
        wmctrl
        wmname

        playerctl
        pamixer

        # xorg
        xorg.xprop
        xorg.xkill
        xorg.xmodmap


        # editors
        vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.

        # browsers
        firefox
        google-chrome
        brave
    ];
}

因此,在重新启动并加载此配置后,当我在 gdm 中从 GNOME 切换到 i3 并登录时,几秒钟后它就会再次打开 gdm。我输入了exec i3-dump-log >> ~/.i3-dump-log.txt我的 i3 配置文件,但.i3-dump-log.txt根本没有创建。

答案1

GDM 往往会遇到这类窗口管理器的问题。GDM 可能没有注册 i3 会话,我
正在使用 i3-gaps 和 GDM
添加可能会有帮助, 如果这不起作用,请尝试使用 lightdmexec i3~/.xinitrc

相关内容