summary refs log tree commit diff
path: root/pkgs/applications/editors/yi/wrapper.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-05-05 11:49:03 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-05-05 11:49:03 +0200
commit375bc8def7c17506bc10f3b6193635f05d5ccc40 (patch)
tree6af7662b245e7998bd18ae20d9e74922c489fb6d /pkgs/applications/editors/yi/wrapper.nix
parent2f75c6845981b38a698cf1a9f620145877c80956 (diff)
parent7f9ccc628403ed88844a4436da3b2944be5560a4 (diff)
downloadnixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar.gz
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar.bz2
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar.lz
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar.xz
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.tar.zst
nixpkgs-375bc8def7c17506bc10f3b6193635f05d5ccc40.zip
Merge staging into closure-size
Diffstat (limited to 'pkgs/applications/editors/yi/wrapper.nix')
-rw-r--r--pkgs/applications/editors/yi/wrapper.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/applications/editors/yi/wrapper.nix b/pkgs/applications/editors/yi/wrapper.nix
new file mode 100644
index 00000000000..a4dc3fe367a
--- /dev/null
+++ b/pkgs/applications/editors/yi/wrapper.nix
@@ -0,0 +1,36 @@
+# 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;
+
+  meta = with stdenv.lib; {
+    description = "Allows Yi to find libraries and the compiler easily";
+    # This wrapper and wrapper only is under PD
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ fuuzetsu ];
+  };
+
+}