Tilling window manager for NixOS

Hello everyone,
I want to use a tilling window manager in NixOS, personal preference for TWM in Fedora is: i3/sway, but I have also used: dwm, bspwm, qlite, awesomewm, herbstluftwm. any advice is welcome. some of the TWM are similar like for example sway is a tiling Wayland compositor and a drop-in replacement for i3.

EDIT: this is a great community and respect to the entire nix team+community for the wonderful job.
Live Long and Prosper :vulcan_salute:
Ari.

Not sure what the question really was but you probably want to look under nixos/modules or just use ā€œfind fileā€ on Github and search up i3.nix, dwm.nix, bspwm.nix, etc for service configurations. If you want to do it on a per user basis, you probably want to use home-manager and its modules.

To look for options I prefer to search through man configuration.nix and man home-configuration.nix for home-manager. Took me a while to discover this when I started using nixos. I used to rely on NixOS Search - Loading...

1 Like

I am using i3 as the main window manager in NixOS and works really well without any major issues so far.
you can find many packages dedicate for i3 at NixOS Search - Loading...

1 Like

You can search NixOS ā€œoptionsā€ to see which window managers can be enabled and some basic options in some cases.

https://nixos.org/nixos/options.html#services.xserver.windowmanager

I’m currently using Qtile, and quite often via vncserver, so I have a common/x.nix that I include in some of my configuration.nix files.

{ config, pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    # Qtile
    alacritty
    rxvt_unicode
    feh
    i3lock-fancy
    xidlehook
    firefox
    keybase-gui
    tigervnc
  ];

  #
  # Open ports in the firewall.
  #
  # 5900-5909: VNC Server.
  #
  networking.firewall.allowedTCPPortRanges = [
    { from = 5900; to = 5909; }
  ];

  # Keybase
  services.kbfs.enable = true;
  services.keybase.enable = true;

  #
  # X Server stuff
  #

  # compton
  services.compton.enable = true;

  services.xserver = {
    enable = true;
    layout = "gb";

    windowManager.qtile = {
      enable = true;
    };

    windowManager.default = "qtile";

    desktopManager.xterm.enable = false;
    desktopManager.default = "none";

    displayManager = {
      slim = {
        enable = true;
        ###defaultUser = "ian";
      };
    };

    ###displayManager.lightdm = {
    ###  enable = true;
    ###  greeters.gtk.indicators = [ "~host" "~spacer" "~clock" "~spacer" "~a11y" "~session" "~power"];
    ###};
  };

  fonts.fonts = with pkgs; [
    powerline-fonts
    font-awesome_5
    source-code-pro
  ];
}
1 Like

For Sway, see also https://github.com/colemickens/nixpkgs-wayland

2 Likes

Hello everyone,
I managed to install i3 works great, will try sway later on. I was asking for experience based advice.

Ari.

Is that repository still necessary? I thought sway and dependencies were in nixpkgs now?

I am using sway from nixos-unstable and it works great. Not sure if it’s available in 19.03.

nixpkgs-wayland can still be used if you want bleeding-edge versions.

thank you all for your valuable advice and provided information on the topic, it was very useful.

Live Long and Prosper :vulcan_salute:
Ari.

I was a fan of the ā€˜ion3’ tiling wm, so much that when the original author quit I ended up maintaining a fork, ā€˜notion’.

We’re gearing up for our next major release, ā€˜notion 4’. The nix build is still a work in progress though, https://github.com/raboof/notion/issues/202 :wink: waves to @moaxcp

3 Likes

i3 / sway work OK for now, and nixOS is just my test pc for experimentation and my daily driver is Fedora for many years, so for now I am good with i3 / sway , I will give ion3 I try when I get the time.

Thank you for the provided information and for your contribution.
Ari.

ion3 hasn’t been maintained since 2009 so I’d argue that it’s not advisable to use it seriously.

I only came to know about it when I had installed the ion shell with nix-env -iA nixos.ion and was doing a nix-env -u and noticed it was replacing the shell with ion3 (same pname as the shell and a higher version number, nix-env isn’t super smart sometimes).

well my experiment PC is my 3-th PC at work connect via switch to change monitor+keyboard+mouse,
First and main driver is Fedora Stable (Fedora 30 now, soon 31), Second for work testing of apps and running bash scripts or other stuff that need high CPU/GPU this is SilberBlue Fedora rawhide (bleeding edge version) (Fedora 32 version now) and my older PC is more for experimenting and playing around with 2 HDDs, one arch one nixos. I have not used nixos for a long time but is works great and I like to experiment so when I find the time I will test out few tilling Window Managers on it, arch and nixos especially is kinda build for TWM, I use gnome on fedora, and i3/sway on SB Fedora32 so TWM is I am used to it and prefer keyboard over mouse usage. ion3 is on my test experiment list of TWM.

ARI.

We’ve been maintaining a fork under name ā€˜notion’, though! We have a new major version coming up, you can get a sneak preview through the nixos package at https://github.com/NixOS/nixpkgs/compare/master...raboof:notion4

1 Like

And for what it’s worth, I’ve been using the notion fork for the last few months, and I’m happy the project is still alive. :slight_smile: I used Ion a loong time ago, but finally gave up on customizing my systems because I hadn’t discovered Nix yet, and reinstalls were always such a pain. Now with Nix, my system is getting more and more customized…

4 Likes

Hello! Can you help me set up a NixOS installation similar to yours? I didn’t find it in the ā€œconfiguration.nixā€ file the part where I should insert the script you shared. Is it in the same file or some other? Should I install the ā€œhome managerā€?
I will be grateful for any help. :v:

At first, a part already set up like this:

  # Enable the X11 windowing system.
  services.xserver.enable = true;
  services.xserver.layout = us;
  services.xserver.xkbOptions = "alt-intl";

  # Enable the Qtile
  services.xserver.windowManager.qtile.enable = true;
  services.xserver.desktopManager.xterm.enable = false;
  services.xserver.desktopManager.default = "none";

After activating the settings the system does not start. Just a ā€œ_ā€ cursor flashing on the black screen and you have to press ā€œAlt + F2ā€ to return to the shell.

Unfortunately I too have had trouble with Qtile on NixOS recently, something changed at some point that broke it.

I’m now using Sway, without a login manager, I just log in to the terminal and run sway.

I installed ā€œswayā€ before and it didn’t work. Now I ran the ā€œswayā€ command again and surprise! Only the mouse pointer appeared on the shell screen on which it is possible to slide across it. But no commands are accepted, not even ā€œAlt + F2ā€.

Hmm, do you have a ~/.config/sway/config yet? I think I copied the one found at /etc/sway/config.