haskell-yi: improve wrapper and use haskell-ng

Now pkgs.yi is the package to use and override

Changed files
+44 -56
pkgs
applications
editors
development
libraries
haskell
diagrams
builder
top-level
+29
pkgs/applications/editors/yi/wrapper.nix
···
+
# Note: this relies on dyre patched for NIX_GHC which is done in
+
# haskell-ng only.
+
#
+
# To use this for hacking of your Yi config file, drop into a shell
+
# with env attribute.
+
{ stdenv, makeWrapper
+
, haskellPackages
+
, extraPackages ? (s: [])
+
}:
+
let
+
yiEnv = haskellPackages.ghcWithPackages
+
(self: [ self.yi ] ++ extraPackages self);
+
in
+
stdenv.mkDerivation {
+
name = "yi-custom";
+
version = "0.0.0.1";
+
unpackPhase = "true";
+
nativeBuildInputs = [ makeWrapper ];
+
+
buildCommand = ''
+
mkdir -p $out/bin
+
makeWrapper ${haskellPackages.yi}/bin/yi $out/bin/yi \
+
--set NIX_GHC ${yiEnv}/bin/ghc
+
'';
+
+
# For hacking purposes
+
env = yiEnv;
+
+
}
-24
pkgs/applications/editors/yi/yi-custom-cabal/LICENSE
···
-
This is free and unencumbered software released into the public domain.
-
-
Anyone is free to copy, modify, publish, use, compile, sell, or
-
distribute this software, either in source code form or as a compiled
-
binary, for any purpose, commercial or non-commercial, and by any
-
means.
-
-
In jurisdictions that recognize copyright laws, the author or authors
-
of this software dedicate any and all copyright interest in the
-
software to the public domain. We make this dedication for the benefit
-
of the public at large and to the detriment of our heirs and
-
successors. We intend this dedication to be an overt act of
-
relinquishment in perpetuity of all present and future rights to this
-
software under copyright law.
-
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-
OTHER DEALINGS IN THE SOFTWARE.
-
-
For more information, please refer to <http://unlicense.org>
-17
pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal
···
-
name: yi-custom
-
version: 0.0.0.1
-
category: Yi
-
synopsis: Convenience wrapper for nix
-
description: Convenience wrapper for nix
-
license: PublicDomain
-
license-file: LICENSE
-
author: Mateusz Kowalczyk
-
maintainer: fuuzetsu@fuuzetsu.co.uk
-
Cabal-Version: >= 1.10
-
build-type: Simple
-
-
library
-
hs-source-dirs: .
-
default-language: Haskell2010
-
build-depends: base, yi
-
ghc-options: -threaded
+1 -1
pkgs/applications/editors/yi/yi-custom.nix
···
maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
};
-
})
+
})
+7 -8
pkgs/development/libraries/haskell/diagrams/builder/wrapper.nix
···
If user need access to more haskell package for building his
diagrams, he simply has to pass these package through the
extra packages function as follow in `config.nix`:
-
+
~~~
diagramBuilderWrapper.override {
extraPackages = self : [myHaskellPackage];
···
­~~~
WARNING:
-
Note that this solution works well but however, as this is a
+
Note that this solution works well but however, as this is a
non-cabal derivation, user should be carefull to never put this
package inside the listing passed as argument to `ghcWithPackages`
as it will silently disregard the package. This silent disregard
should be regarded as an issue for `ghcWithPackages`. It should
rather raise an error instead when a non-cabal dirivation is
directly passed to it. The alternative would have been to
-
use a fake cabal file in order to make this a cabal derivation
-
such as what `yiCustom` package did.
+
use a fake cabal file in order to make this a cabal derivation.
*/
-
{ stdenv, diagramsBuilder, ghcWithPackages, makeWrapper,
+
{ stdenv, diagramsBuilder, ghcWithPackages, makeWrapper,
extraPackages ? (self: []) }:
let
-
# Used same technique as for the yiCustom package.
-
w = ghcWithPackages
+
# Used same technique such as xmonad
+
w = ghcWithPackages
(self: [ diagramsBuilder ] ++ extraPackages self);
wrappedGhc = w.override { ignoreCollisions = true; };
in
···
'';
preferLocalBuild = true;
meta = diagramsBuilder.meta;
-
}
+
}
+5
pkgs/top-level/all-packages.nix
···
inherit (xlibs) libXt libXaw libXtst xextproto libXi libXpm gccmakedep;
};
+
# To expose more packages for Yi, override the extraPackages arg.
+
yi = callPackage ../applications/editors/yi/wrapper.nix {
+
haskellPackages = haskellngPackages;
+
};
+
youtube-dl = callPackage ../tools/misc/youtube-dl { };
zbar = callPackage ../tools/graphics/zbar {
+2 -6
pkgs/top-level/haskell-packages.nix
···
wordTrie = callPackage ../development/libraries/haskell/word-trie {};
-
# This is an unwrapped version of Yi, it will not behave well (no
-
# M-x or reload). Use ‘yiCustom’ instead.
+
# This is an unwrapped version of Yi, it will not behave well. Use
+
# ‘yi’ from all-packages.nix instead.
yi = callPackage ../applications/editors/yi/yi.nix { };
-
-
yiCustom = callPackage ../applications/editors/yi/yi-custom.nix {
-
extraPackages = pkgs: [];
-
};
yiFuzzyOpen = callPackage ../development/libraries/haskell/yi-fuzzy-open {};