meditans
meditans

Reputation: 586

NixOS beginner: xmonad and haskellmode in NixOS 14.04

I'm trying so set up a NixOS VM for code development in haskell, and got into troubles with the basic installation of both xmonad and emacs. The relevant part of my /etc/nixos/configuration.nix is

environment.systemPackages = with pkgs; [
    emacs
    emacs24Packages.haskellMode
    xlibs.xmessage
    haskellPackages.haskellPlatform.ghc
    haskellPackages.xmobar
    haskellPackages.xmonad
    haskellPackages.xmonadContrib
    haskellPackages.xmonadExtras
];

I put together these problems as I suspect they're both caused by a fundamental incomprehension of something on my behalf, so the cause may be common.

Upvotes: 5

Views: 3733

Answers (3)

I am unsure why you're unable to compile that... I can't offer a solution, but personally, I am able to compile my XMonad config which includes

import XMonad.Util.EZConfig

This is the relevant lines in my configuration.

    environment.systemPackages = with pkgs; [
      haskellPackages.xmobar
      haskellPackages.xmonad
      haskellPackages.xmonad-contrib
      haskellPackages.xmonad-extras
    ];

    programs.dconf.enable = true;

    services = {
      dbus = {
        enable = true;
        packages = [ pkgs.dconf ];
      };

      xserver = {
        enable = true;

        libinput = {
          enable = true;
          touchpad.disableWhileTyping = true;
        };

        serverLayoutSection = ''
          Option "StandbyTime" "0"
          Option "SuspendTime" "0"
          Option "OffTime"     "0"
        '';

        displayManager = {
          defaultSession = "none+xmonad";
          lightdm.enable = true;
          lightdm.greeters.mini.enable = true;
        };

        windowManager.xmonad = {
          enable = true;
          enableContribAndExtras = true;
        };

        xkbOptions = "caps:ctrl_modifier";
      };
    };

    env = {
      XMONAD_CONFIG_DIR = "$XDG_CONFIG_HOME/xmonad";
      XMONAD_CACHE_DIR = "$XDG_CONFIG_HOME/xmonad";
      XMONAD_DATA_DIR = "$XDG_CONFIG_HOME/xmonad";
    };

As someone pointed out, it might be because you don't have the line:

enableContribAndExtras = true;

I posted my configuration also so you could see how this would tie into a more extensive configuration, in this case for lightdm.

Upvotes: 2

rmoro
rmoro

Reputation: 393

just add

    windowManager.xmonad.enableContribAndExtras = true;

to

    /etc/nixos/configuration.nix

Then start xmonad the usual way through your .xsession file

Upvotes: 4

grwp
grwp

Reputation: 97

I can't add comment for now... But I think it's a problem with cabal local and global repositories.

As I see, "Nix allows users to install packages without requiring root privileges, and provides each user with its own view of the set of installed packages. Multiple versions of a program or library can be installed at the same time. Package upgrades are atomic and can be rolled back."

Maybe you can use ghc-pkg list to see if, in root and normal user, the packages are well installed.

Upvotes: 2

Related Questions