[Nix-dev] some basic questions from a new NixOS user

Linus Arver linusarver at gmail.com
Tue Nov 29 04:59:32 CET 2011


On Sat, Nov 26, 2011 at 09:20:34PM -0700, Kevin Quick wrote:
> On Sat, 26 Nov 2011 15:42:03 -0700, Linus Arver
> <linusarver at gmail.com> wrote:
> 
> >this in my configuration.nix:
> >   services.xserver = {
> >        enable = true;
> >        layout = "us";
> >       # Automatic login as regular user (no need to put up with entering
> >        # password)
> >        displayManager = {
> >            auto = {
> >                enable = true;
> >                user = "l"; # login as "l"
> >            };
> >        };
> >       # Enable XMonad
> >        windowManager = {
> >            xmonad.enable = true;
> >        };
> >    };
> 
> I have:
> 
>   services.xserver = {
>     enable = true;
>     ...
>     windowManager.xmonad.enable = true;
>     windowManager.default = "xmonad";
>     ...
>   };
> 
> This seems to work fine. 

Thanks! I added

    windowManager.default = "xmonad";

into my configuration and now xmonad finally starts up automatically on
boot!

> Although xmonad restarts itself out of
> your .xmonad directory, the main version is available:
> 
> $ which xmonad
> /home/kquick/.nix-profile/bin/xmonad
> $ ls -lh `which xmonad`
> lrwxrwxrwx 1 root nixbld 67 Nov  2 12:59
> /home/kquick/.nix-profile/bin/xmonad ->
> /nix/store/f6zlgcyhy76k2kal3v47vmj5bsvpm3px-xmonad-0.9.2/bin/xmonad
> $

So, I stated in my previous email that I thought the xmonad-related
things in configuration.nix were essentially broken. I've since
installed xmonad with nix-env, and now xmonad is in my path.

But I must ask, how did you install xmonad? I tried "nix-env -i xmonad"
but it did not work, so I looked into all the available packages and
found "haskell-xmonad-ghc7.0.4" which is what I ended up installing.

Strangely, it appears that the haskell packages cannot see each other
properly, because I cannot use any of the xmonad-contrib modules in my
xmonad.hs, even though I've installed xmonad-contrib. I can fire up
ghci, but I can't even load up the "XMonad" Haskell module, either.
Strange...

I guess this is the price you have to pay to run an exotic setup on an
alpha-stage OS...

> >I did a "nixos-rebuild switch", but xmonad does not get started.
> 
> In my experience there are some elements that cannot "switch" and a
> reboot is required; I don't recall if xmonad was one of these, but
> it may be if X is not restarted by the switch.

First, let me clarify my poor choice of words --- what I really meant
was: "I did a 'nix-rebuild switch', but xmonad does not get started
after I reboot into the new configuration." But yes, your point still
stands --- X and xmonad do not get restarted immediately after
"nixos-rebuild switch." I did read somewhere in the manual that not all
processes get restarted (or that NixOS *tries* to restart all services
if it can), so this quirk won't confuse newbies, I think.

-Linus


More information about the nix-dev mailing list