about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-10-15 04:23:05 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-10-15 04:31:03 +0100
commit8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9 (patch)
tree7eeb8302219be1c8f3725064967d48c762ad42fe /pkgs/applications/editors
parent7562afbe19a04341f7a45bffd8aa53b194a43b97 (diff)
downloadnixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar.gz
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar.bz2
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar.lz
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar.xz
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.tar.zst
nixlib-8842fcfdb1619e09eb504acd5ea4ebbced7ae7d9.zip
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.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/yi/yi-custom-cabal/LICENSE24
-rw-r--r--pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal17
-rw-r--r--pkgs/applications/editors/yi/yi-custom.nix40
3 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE b/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE
new file mode 100644
index 000000000000..cf1ab25da034
--- /dev/null
+++ b/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE
@@ -0,0 +1,24 @@
+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>
diff --git a/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal b/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal
new file mode 100644
index 000000000000..d9ffbb8e4817
--- /dev/null
+++ b/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal
@@ -0,0 +1,17 @@
+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
diff --git a/pkgs/applications/editors/yi/yi-custom.nix b/pkgs/applications/editors/yi/yi-custom.nix
new file mode 100644
index 000000000000..05b26f7046f2
--- /dev/null
+++ b/pkgs/applications/editors/yi/yi-custom.nix
@@ -0,0 +1,40 @@
+# This is a manually-written expression over an in-tree cabal file.
+# It's awkward but this way allows the package user to pass in
+# extraPackages without much extra hassle on their end, similarly how
+# the XMonad service handles it: the difference is that we don't have
+# anything like XMONAD_GHC…
+#
+# The idea is that the user changes their configs using any libraries
+# he likes and then builds it using this expression. Once that's done,
+# ‘reload’ and similar functions should all work as long as the user
+# doesn't need new libraries at which point they should add them to
+# extraPackages and rebuild from the expression.
+{ cabal, yi, extraPackages, makeWrapper }:
+
+cabal.mkDerivation (self: rec {
+  pname = "yi-custom";
+  version = "0.0.0.1";
+  src = ./yi-custom-cabal;
+  isLibrary = true;
+  buildDepends = extraPackages ++ [ yi ];
+  buildTools = [ makeWrapper ];
+  noHaddock = true;
+  doCheck = false;
+
+  # Allows Yi to find the libraries it needs at runtime. We drop ‘:’
+  # from this GHC_PACKAGE_PATH because we're wrapping over a different
+  # wrapper that used --prefix: if we didn't, we end up with a
+  # double-colon, confusing GHC.
+  postInstall = ''
+    makeWrapper ${yi}/bin/yi $out/bin/yi --set GHC_PACKAGE_PATH ''${GHC_PACKAGE_PATH%?}
+  '';
+
+  meta = {
+    homepage = "http://haskell.org/haskellwiki/Yi";
+    description = "Wrapper over user-specified Haskell libraries for use in Yi config";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+    maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
+  };
+
+})
\ No newline at end of file