diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix index ccd2dc05adbe..ed01ddd3e335 100644 --- a/pkgs/applications/window-managers/xmonad/default.nix +++ b/pkgs/applications/window-managers/xmonad/default.nix @@ -1,42 +1,17 @@ -{stdenv, fetchurl, ghc, X11, xmessage}: - -stdenv.mkDerivation (rec { +{cabal, X11, xmessage}: +cabal.mkDerivation (self : { pname = "xmonad"; - version = "0.5"; - - name = "${pname}-${version}"; - - src = fetchurl { - url = "http://hackage.haskell.org/packages/archive/${pname}/${version}/${name}.tar.gz"; - sha256 = "cfcc4501b000fa740ed35a5be87dc01216e036219551630dcf71d9c3cf57e4c4"; - }; - - buildInputs = [ghc X11]; - + name = "${self.fname}"; + version = "0.7"; + sha256 = "d5ee338eb6d0680082e20eaafa0b23b32358fffe69e2ec4ad7bdf6e03c751d67"; + extraBuildInputs = [X11]; meta = { description = "xmonad is a tiling window manager for X"; }; - configurePhase = '' - sed -i 's|"xmessage"|"${xmessage}/bin/xmessage"|' XMonad/Core.hs - ghc --make Setup.lhs - ./Setup configure --prefix="$out" + preConfigure = '' + substituteInPlace XMonad/Core.hs --replace \ + '"xmessage"' '"${xmessage}/bin/xmessage"' ''; - - buildPhase = '' - ./Setup build - ''; - - installPhase = '' - ./Setup copy - ./Setup register --gen-script - mkdir $out/nix-support - sed -i 's/|.*\(ghc-pkg update\)/| \1/' register.sh - cp register.sh $out/nix-support/register-ghclib.sh - sed -i 's/\(ghc-pkg update\)/\1 --user/' register.sh - mkdir -p $out/bin - cp register.sh $out/bin/register-ghclib-${name}.sh - ''; - }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2f0139b6167a..4d114779594b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5878,7 +5878,7 @@ let pkgs = rec { }; xmonad = import ../applications/window-managers/xmonad { - inherit stdenv fetchurl ghc X11; + inherit cabal X11; inherit (xlibs) xmessage; };