summary refs log tree commit diff
path: root/pkgs/shells/fish
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-04-17 14:03:07 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-04-17 14:47:32 -0500
commitddaea6ac77177c91576568af4b6f6d85195559af (patch)
tree0292a346327a613a52b95492aea9ed76d8c55dfe /pkgs/shells/fish
parentd308ac923376b76183a0b4078f808ce40af8f86b (diff)
downloadnixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar.gz
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar.bz2
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar.lz
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar.xz
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.tar.zst
nixpkgs-ddaea6ac77177c91576568af4b6f6d85195559af.zip
pkgs/shells: move extensions to subdirs
These are not reaal shells and should go into their parent shell
directory.
Diffstat (limited to 'pkgs/shells/fish')
-rw-r--r--pkgs/shells/fish/fish-foreign-env/default.nix31
-rw-r--r--pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch23
2 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/shells/fish/fish-foreign-env/default.nix b/pkgs/shells/fish/fish-foreign-env/default.nix
new file mode 100644
index 00000000000..445e961c649
--- /dev/null
+++ b/pkgs/shells/fish/fish-foreign-env/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, gnused, bash, coreutils }:
+
+stdenv.mkDerivation rec {
+  name = "fish-foreign-env-${version}";
+  version = "git-20170324";
+
+  src = fetchFromGitHub {
+    owner = "oh-my-fish";
+    repo = "plugin-foreign-env";
+    rev = "baefbd690f0b52cb8746f3e64b326d82834d07c5";
+    sha256 = "0lwp6hy3kfk7xfx4xvbk1ir8zkzm7gfjbm4bf6xg1y6iw9jq9dnl";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share/fish-foreign-env/functions/
+    cp functions/* $out/share/fish-foreign-env/functions/
+    sed -e "s|sed|${gnused}/bin/sed|" \
+        -e "s|bash|${bash}/bin/bash|" \
+        -e "s|\| tr|\| ${coreutils}/bin/tr|" \
+        -i $out/share/fish-foreign-env/functions/*
+  '';
+
+  patches = [ ./suppress-harmless-warnings.patch ];
+
+  meta = with stdenv.lib; {
+    description = "A foreign environment interface for Fish shell";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jgillich ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch b/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch
new file mode 100644
index 00000000000..5e4569f0a15
--- /dev/null
+++ b/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch
@@ -0,0 +1,23 @@
+diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish
+index 34a25e3..3d94135 100644
+--- a/functions/fenv.apply.fish
++++ b/functions/fenv.apply.fish
+@@ -27,11 +27,17 @@ function fenv.apply
+     for variable in $variables
+         set key (echo $variable | sed 's/=.*//')
+         set value (echo $variable | sed 's/[^=]*=//')
++        set ignore PATH _
+ 
+         if test "$key" = 'PATH'
+           set value (echo $value | tr ':' '\n')
+         end
+ 
+-        set -g -x $key $value
++        if contains $key $ignore
++          set -g -x $key $value ^/dev/null
++        else
++          set -g -x $key $value
++        end
++
+     end
+ end