haskell-yi-custom: convenience wrapper for configs

Now to use Yi along with its config the user passes all the extra
libraries wanted by their config as extraPackages and builds the
expression. This means there is no hassle from the user about having to
manually create a cabal file and wrap over the Yi binary.

+87
+24
pkgs/applications/editors/yi/yi-custom-cabal/LICENSE
···
··· 1 + This is free and unencumbered software released into the public domain. 2 + 3 + Anyone is free to copy, modify, publish, use, compile, sell, or 4 + distribute this software, either in source code form or as a compiled 5 + binary, for any purpose, commercial or non-commercial, and by any 6 + means. 7 + 8 + In jurisdictions that recognize copyright laws, the author or authors 9 + of this software dedicate any and all copyright interest in the 10 + software to the public domain. We make this dedication for the benefit 11 + of the public at large and to the detriment of our heirs and 12 + successors. We intend this dedication to be an overt act of 13 + relinquishment in perpetuity of all present and future rights to this 14 + software under copyright law. 15 + 16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 + OTHER DEALINGS IN THE SOFTWARE. 23 + 24 + For more information, please refer to <http://unlicense.org>
+17
pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal
···
··· 1 + name: yi-custom 2 + version: 0.0.0.1 3 + category: Yi 4 + synopsis: Convenience wrapper for nix 5 + description: Convenience wrapper for nix 6 + license: PublicDomain 7 + license-file: LICENSE 8 + author: Mateusz Kowalczyk 9 + maintainer: fuuzetsu@fuuzetsu.co.uk 10 + Cabal-Version: >= 1.10 11 + build-type: Simple 12 + 13 + library 14 + hs-source-dirs: . 15 + default-language: Haskell2010 16 + build-depends: base, yi 17 + ghc-options: -threaded
+40
pkgs/applications/editors/yi/yi-custom.nix
···
··· 1 + # This is a manually-written expression over an in-tree cabal file. 2 + # It's awkward but this way allows the package user to pass in 3 + # extraPackages without much extra hassle on their end, similarly how 4 + # the XMonad service handles it: the difference is that we don't have 5 + # anything like XMONAD_GHC… 6 + # 7 + # The idea is that the user changes their configs using any libraries 8 + # he likes and then builds it using this expression. Once that's done, 9 + # ‘reload’ and similar functions should all work as long as the user 10 + # doesn't need new libraries at which point they should add them to 11 + # extraPackages and rebuild from the expression. 12 + { cabal, yi, extraPackages, makeWrapper }: 13 + 14 + cabal.mkDerivation (self: rec { 15 + pname = "yi-custom"; 16 + version = "0.0.0.1"; 17 + src = ./yi-custom-cabal; 18 + isLibrary = true; 19 + buildDepends = extraPackages ++ [ yi ]; 20 + buildTools = [ makeWrapper ]; 21 + noHaddock = true; 22 + doCheck = false; 23 + 24 + # Allows Yi to find the libraries it needs at runtime. We drop ‘:’ 25 + # from this GHC_PACKAGE_PATH because we're wrapping over a different 26 + # wrapper that used --prefix: if we didn't, we end up with a 27 + # double-colon, confusing GHC. 28 + postInstall = '' 29 + makeWrapper ${yi}/bin/yi $out/bin/yi --set GHC_PACKAGE_PATH ''${GHC_PACKAGE_PATH%?} 30 + ''; 31 + 32 + meta = { 33 + homepage = "http://haskell.org/haskellwiki/Yi"; 34 + description = "Wrapper over user-specified Haskell libraries for use in Yi config"; 35 + license = self.stdenv.lib.licenses.publicDomain; 36 + platforms = self.ghc.meta.platforms; 37 + maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ]; 38 + }; 39 + 40 + })
+6
pkgs/top-level/haskell-packages.nix
··· 3090 3091 wordTrie = callPackage ../development/libraries/haskell/word-trie {}; 3092 3093 yi = callPackage ../applications/editors/yi/yi.nix { }; 3094 3095 yiContrib = callPackage ../development/libraries/haskell/yi-contrib {}; 3096 3097 yiLanguage = callPackage ../development/libraries/haskell/yi-language {}; 3098
··· 3090 3091 wordTrie = callPackage ../development/libraries/haskell/word-trie {}; 3092 3093 + # You should prefer ‘yiCustom’ over ‘yi’ unless you never plan to 3094 + # use any external libraries in your config. 3095 yi = callPackage ../applications/editors/yi/yi.nix { }; 3096 3097 yiContrib = callPackage ../development/libraries/haskell/yi-contrib {}; 3098 + 3099 + yiCustom = callPackage ../applications/editors/yi/yi-custom.nix { 3100 + extraPackages = []; 3101 + }; 3102 3103 yiLanguage = callPackage ../development/libraries/haskell/yi-language {}; 3104