about summary refs log tree commit diff
path: root/pkgs/applications/window-managers/xmonad/wrapper.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-02-03 01:05:23 +0300
committerNikolay Amiantov <ab@fmap.me>2015-02-03 01:05:23 +0300
commitb7bb524f04c9e31c19d19086d1af0eda7d2f4ca8 (patch)
tree8f2ac6eed0eae17ddb98179b10b95161cf2ce853 /pkgs/applications/window-managers/xmonad/wrapper.nix
parentf8038b0c6c3c61f081c52a9e467f7f8d731a74ff (diff)
nixos/xmonad: move to haskell-ng and make a wrapper
Diffstat (limited to 'pkgs/applications/window-managers/xmonad/wrapper.nix')
-rw-r--r--pkgs/applications/window-managers/xmonad/wrapper.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/applications/window-managers/xmonad/wrapper.nix b/pkgs/applications/window-managers/xmonad/wrapper.nix
new file mode 100644
index 0000000000000..cddaeb5f799f2
--- /dev/null
+++ b/pkgs/applications/window-managers/xmonad/wrapper.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildEnv, ghcWithPackages, xmessage, makeWrapper, packages }:
+
+let
+xmonadEnv = ghcWithPackages (self: [ self.xmonad ] ++ packages self);
+drv = buildEnv {
+  name = "xmonad-with-packages";
+
+  paths = [ xmonadEnv ];
+
+  postBuild = ''
+    # TODO: This could be avoided if buildEnv could be forced to create all directories
+    rm $out/bin
+    mkdir $out/bin
+    for i in ${xmonadEnv}/bin/*; do
+      ln -s $i $out/bin
+    done
+    wrapProgram $out/bin/xmonad \
+      --set XMONAD_GHC "${xmonadEnv}/bin/ghc" \
+      --set XMONAD_XMESSAGE "${xmessage}/bin/xmessage"
+  '';
+  };
+in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })