Could not find module ‘XMonad’












0















I have a fresh NixOS installation, and I want to use my custom XMonad configuration. However, I'm getting the following error:



$ xmonad --recompile
XMonad will use ghc to recompile, because "/home/amy/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/amy/.xmonad/xmonad.hs

xmonad.hs:1:1: error:
Could not find module ‘XMonad’
Use -v to see a list of the files searched for.
|
1 | import XMonad
| ^^^^^^^^^^^^^


Here are the relevant parts of my configuration.nix:



  # List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
bash
dmenu2
dzen2
emacs
firefox
gitAndTools.gitFull
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
gcc
ghc
stack
x11
xmonad-with-packages
xorg.libX11
xsel
wget
];

. . .

services.xserver = {
enable = true;
layout = "ie";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = haskellPackages: [
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
];
};
};
# windowManager.default = "xmonad";


I have read NixOS beginner: xmonad and haskellmode in NixOS 14.04, but I already have windowManager.xmonad.enableContribAndExtras = true; in my configuration.nix.



EDIT: Just to clarify, I am on NixOS, but I am not using Nix to build my XMonad configuration. I am doing things the ordinary XMonad way: I have a .xmonad directory with my configuration in xmonad.hs, and I am running xmonad --recompile to build it.



EDIT: When I look for the relevant packages as root, I find them.



# nix-env -q
xmonad-0.14.2
xmonad-contrib-0.14
xmonad-extras-0.14


But as an ordinary user, the following command returns nothing.



$ nix-env -q


How do I make these packages visible to a non-root account?



EDIT: Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times.










share|improve this question

























  • Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

    – Chris Stryczynski
    Nov 23 '18 at 15:10











  • I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

    – Chris Stryczynski
    Nov 23 '18 at 15:13











  • @ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

    – mhwombat
    Nov 27 '18 at 10:08











  • No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

    – Chris Stryczynski
    Nov 27 '18 at 21:13






  • 1





    As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

    – Teo Klestrup Röijezon
    Dec 13 '18 at 20:38
















0















I have a fresh NixOS installation, and I want to use my custom XMonad configuration. However, I'm getting the following error:



$ xmonad --recompile
XMonad will use ghc to recompile, because "/home/amy/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/amy/.xmonad/xmonad.hs

xmonad.hs:1:1: error:
Could not find module ‘XMonad’
Use -v to see a list of the files searched for.
|
1 | import XMonad
| ^^^^^^^^^^^^^


Here are the relevant parts of my configuration.nix:



  # List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
bash
dmenu2
dzen2
emacs
firefox
gitAndTools.gitFull
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
gcc
ghc
stack
x11
xmonad-with-packages
xorg.libX11
xsel
wget
];

. . .

services.xserver = {
enable = true;
layout = "ie";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = haskellPackages: [
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
];
};
};
# windowManager.default = "xmonad";


I have read NixOS beginner: xmonad and haskellmode in NixOS 14.04, but I already have windowManager.xmonad.enableContribAndExtras = true; in my configuration.nix.



EDIT: Just to clarify, I am on NixOS, but I am not using Nix to build my XMonad configuration. I am doing things the ordinary XMonad way: I have a .xmonad directory with my configuration in xmonad.hs, and I am running xmonad --recompile to build it.



EDIT: When I look for the relevant packages as root, I find them.



# nix-env -q
xmonad-0.14.2
xmonad-contrib-0.14
xmonad-extras-0.14


But as an ordinary user, the following command returns nothing.



$ nix-env -q


How do I make these packages visible to a non-root account?



EDIT: Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times.










share|improve this question

























  • Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

    – Chris Stryczynski
    Nov 23 '18 at 15:10











  • I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

    – Chris Stryczynski
    Nov 23 '18 at 15:13











  • @ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

    – mhwombat
    Nov 27 '18 at 10:08











  • No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

    – Chris Stryczynski
    Nov 27 '18 at 21:13






  • 1





    As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

    – Teo Klestrup Röijezon
    Dec 13 '18 at 20:38














0












0








0








I have a fresh NixOS installation, and I want to use my custom XMonad configuration. However, I'm getting the following error:



$ xmonad --recompile
XMonad will use ghc to recompile, because "/home/amy/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/amy/.xmonad/xmonad.hs

xmonad.hs:1:1: error:
Could not find module ‘XMonad’
Use -v to see a list of the files searched for.
|
1 | import XMonad
| ^^^^^^^^^^^^^


Here are the relevant parts of my configuration.nix:



  # List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
bash
dmenu2
dzen2
emacs
firefox
gitAndTools.gitFull
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
gcc
ghc
stack
x11
xmonad-with-packages
xorg.libX11
xsel
wget
];

. . .

services.xserver = {
enable = true;
layout = "ie";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = haskellPackages: [
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
];
};
};
# windowManager.default = "xmonad";


I have read NixOS beginner: xmonad and haskellmode in NixOS 14.04, but I already have windowManager.xmonad.enableContribAndExtras = true; in my configuration.nix.



EDIT: Just to clarify, I am on NixOS, but I am not using Nix to build my XMonad configuration. I am doing things the ordinary XMonad way: I have a .xmonad directory with my configuration in xmonad.hs, and I am running xmonad --recompile to build it.



EDIT: When I look for the relevant packages as root, I find them.



# nix-env -q
xmonad-0.14.2
xmonad-contrib-0.14
xmonad-extras-0.14


But as an ordinary user, the following command returns nothing.



$ nix-env -q


How do I make these packages visible to a non-root account?



EDIT: Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times.










share|improve this question
















I have a fresh NixOS installation, and I want to use my custom XMonad configuration. However, I'm getting the following error:



$ xmonad --recompile
XMonad will use ghc to recompile, because "/home/amy/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/amy/.xmonad/xmonad.hs

xmonad.hs:1:1: error:
Could not find module ‘XMonad’
Use -v to see a list of the files searched for.
|
1 | import XMonad
| ^^^^^^^^^^^^^


Here are the relevant parts of my configuration.nix:



  # List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
bash
dmenu2
dzen2
emacs
firefox
gitAndTools.gitFull
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
gcc
ghc
stack
x11
xmonad-with-packages
xorg.libX11
xsel
wget
];

. . .

services.xserver = {
enable = true;
layout = "ie";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = haskellPackages: [
haskellPackages.xmonad
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
];
};
};
# windowManager.default = "xmonad";


I have read NixOS beginner: xmonad and haskellmode in NixOS 14.04, but I already have windowManager.xmonad.enableContribAndExtras = true; in my configuration.nix.



EDIT: Just to clarify, I am on NixOS, but I am not using Nix to build my XMonad configuration. I am doing things the ordinary XMonad way: I have a .xmonad directory with my configuration in xmonad.hs, and I am running xmonad --recompile to build it.



EDIT: When I look for the relevant packages as root, I find them.



# nix-env -q
xmonad-0.14.2
xmonad-contrib-0.14
xmonad-extras-0.14


But as an ordinary user, the following command returns nothing.



$ nix-env -q


How do I make these packages visible to a non-root account?



EDIT: Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times.







nixos xmonad






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 10:09







mhwombat

















asked Nov 22 '18 at 12:48









mhwombatmhwombat

6,2481443




6,2481443













  • Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

    – Chris Stryczynski
    Nov 23 '18 at 15:10











  • I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

    – Chris Stryczynski
    Nov 23 '18 at 15:13











  • @ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

    – mhwombat
    Nov 27 '18 at 10:08











  • No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

    – Chris Stryczynski
    Nov 27 '18 at 21:13






  • 1





    As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

    – Teo Klestrup Röijezon
    Dec 13 '18 at 20:38



















  • Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

    – Chris Stryczynski
    Nov 23 '18 at 15:10











  • I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

    – Chris Stryczynski
    Nov 23 '18 at 15:13











  • @ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

    – mhwombat
    Nov 27 '18 at 10:08











  • No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

    – Chris Stryczynski
    Nov 27 '18 at 21:13






  • 1





    As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

    – Teo Klestrup Röijezon
    Dec 13 '18 at 20:38

















Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

– Chris Stryczynski
Nov 23 '18 at 15:10





Could you include the output of ghc-pkg list? It probably won't show XMonad. You probably need to add ghc with packages as described in this question: stackoverflow.com/questions/47377748/…

– Chris Stryczynski
Nov 23 '18 at 15:10













I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

– Chris Stryczynski
Nov 23 '18 at 15:13





I think the way XMonad is packaged on Nixos is really convoluted. If you build it independently it's a lot easier to understand imo. I followed this guide: functor.tokyo/blog/2018-02-16-setup-xmonad-on-nixos

– Chris Stryczynski
Nov 23 '18 at 15:13













@ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

– mhwombat
Nov 27 '18 at 10:08





@ChrisStryczynski thank you for your suggestions; I learned a lot from them. Strangely, when I rebooted, XMonad magically worked, compiling my configuration without problems. I don't know why rebooting helped, because I'd done nixos-rebuild switch several times. But if you'd like to turn your comments into an answer, I'll happily accept it.

– mhwombat
Nov 27 '18 at 10:08













No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

– Chris Stryczynski
Nov 27 '18 at 21:13





No worries glad to hear it's working. Possibly it was recompiling the old config / executable somehow.

– Chris Stryczynski
Nov 27 '18 at 21:13




1




1





As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

– Teo Klestrup Röijezon
Dec 13 '18 at 20:38





As an aside, nix-env -q only shows packages installed into that profile. So nix-env -q as a user won't show you programs that root installed using nix-env -i even though those programs in your $PATH, and even root won't see packages that are were installed via environment.systemPackages.

– Teo Klestrup Röijezon
Dec 13 '18 at 20:38












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431408%2fcould-not-find-module-xmonad%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431408%2fcould-not-find-module-xmonad%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$