NixOS初学者:NixOS 14.04中的xmonad和haskellmode [英] NixOS beginner: xmonad and haskellmode in NixOS 14.04

查看:121
本文介绍了NixOS初学者:NixOS 14.04中的xmonad和haskellmode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在Haskell中设置用于代码开发的NixOS VM,并且在基本安装xmonad和emacs时遇到了麻烦.我的/etc/nixos/configuration.nix的相关部分是

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

  • xmonad:当我尝试编译代码时,xmonad抱怨说找不到模块XMonad.Util.EZConfig. 用ghc编译xmonad.hs是可以的,而且我也可以将模块加载到ghci中. 在#nixos频道上,有人告诉我使用功能ghcWithPackages,但是我无法解决此问题.而且,我想首先理解为什么会出现此问题,因为在我看来这是一个非常简单的用例.我遇到的一个最小的xmonad.hs是:

    • xmonad: when I try to compile the code, xmonad complains that it couldn't find the module XMonad.Util.EZConfig. Compiling xmonad.hs with ghc is ok, and I'm also able to load the module into ghci. On the #nixos channel, I was told to use the function ghcWithPackages, but I wasn't able to correct the problem. Moreover, I'd like to understand why there is this problem in the first place, as it seems to me that this is a very simple use case. A minimal xmonad.hs with which I have the problem is:

      import XMonad
      import XMonad.Util.EZConfig
      
      main = xmonad $ defaultConfig
        { modMask = mod4Mask
        , terminal = "konsole"
        }
        `additionalKeysP`
        [ ("M-e", spawn "emacs")
        , ("M-f", spawn "firefox")
        ]
      

    • emacs:安装了haskellmode软件包后(请参见上面的configuration.nix),我无法在emacs中输入haskell-mode.

    • emacs: after the installation of the package haskellmode (look at the configuration.nix above), I'm not able to enter haskell-mode in emacs.

      我把这些问题归为一类,因为我怀疑它们都是由我对某件事的根本不了解所引起的,所以原因可能很普遍.

      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.

      推荐答案

      只需添加

          windowManager.xmonad.enableContribAndExtras = true;
      

          /etc/nixos/configuration.nix
      

      然后以通常的方式通过您的.xsession文件启动xmonad

      Then start xmonad the usual way through your .xsession file

      这篇关于NixOS初学者:NixOS 14.04中的xmonad和haskellmode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆