Install and use XMonad as wm

Hello everyone!

Nice to find this discours :slight_smile:

I‘m using Debian with XMonad for a long time and now I want to learn something new. Today I installed nixOS. I install the system without any errors and get a Shell after booting. The first thing I want to do is install Xmonad (and xmobar) as wm. I don’t know where to start. Did someone have a step by step tutorial or a link for a tutorial? Whould be nice!

Thanks a lot.

Cheers 0x17

Hi there,

Welcome to nixos.

Depending on what you want to do (with/without display manager etc) you need to adjust your configuration. Check these options for example. Also feel free to cheat by searching on github for other people’s dotfiles. Some of us like to use home-manager for it, some of us just handles it on configuration.nix.

1 Like


I am glad to use (and learn about) NixOS.

I want to use XMonad as windowmanager. I already add the needed lines to the configurations.nix file.

First question: do I need to rebuild nixOS everytime I do changes in the configurations.nix file?

Somehow I got xmonad running. Need some modifications to run it like in Debian but it works.

Second Question: what is the common way to install packages? Add them to the configurations.nix or via Terminal and „nix-env -i vim“?

Thank you a lot. I know these are dumb questions

Yes, the new configuration needs to be build, you’ll have a new profile link (checkable via ls -ld /nix/var/nix/profiles/system* or sudo nix-env -p /nix/var/nix/profiles/system --list-generations). You can test the new profile, switch to it, add to the bootloader however you like (check nixos-rebuild --help).

People coming from “normal” distros tend to use nix-env, but IMHO it’s just cluttering your profile (and won’t get updated, wasting space with their dependencies etc. unless you remember to upgrade them via nix-env -u). But it’s user choice at the end. Personally I use nix-env if I’d like to quickly try something and get rid of it afterwards, otherwise add it to config. Also configuration allows you to build your preferred environment step by step with overrides etc. You can dig how people override packages like neovim on github for example.

1 Like