0

So I previously used i3 on ubuntu so I do know the basics and how to change desktop/window manager. I just recently switch to nixos and tried installing i3 through the configuration.nix.
Configuration.nix:

# 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
];

}

So after rebooting and loading this configuration, when I switch from GNOME to i3 in gdm and login, after a few seconds it just opens gdm again. I put exec i3-dump-log >> ~/.i3-dump-log.txt in my i3 config file but the .i3-dump-log.txt was not created at all.

1 Answers1

0

GDM tends to have problem with these sort of window managers. GDM might not be registering the i3 session
I'm using i3-gaps with GDM
Adding exec i3 in ~/.xinitrc might help
If that doesn't work, try using lightdm