any-nix-shell: update overlay

This commit is contained in:
Timothy DeHerrera 2020-12-29 20:16:26 -07:00
parent 37d40e0cfe
commit a4409f79e4
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
2 changed files with 6 additions and 59 deletions

View File

@ -1,6 +1,11 @@
final: prev: { final: prev: {
any-nix-shell = prev.any-nix-shell.overrideAttrs any-nix-shell = prev.any-nix-shell.overrideAttrs
(o: { (o: {
patches = [ ../profiles/develop/zsh/patches/0001-nix-run-is-now-nix-shell-semantically.patch ]; src = prev.fetchFromGitHub {
owner = "haslersn";
repo = "any-nix-shell";
rev = "e6b86e6e6d86cf7bcbc2691596d54d0a1db29d29";
hash = "sha256-ZmMl58sYVj5TVw19nxPht5nAv9qWnIyImRhs1/TrsRc=";
};
}); });
} }

View File

@ -1,58 +0,0 @@
From d2418a9ba05402d969a63f0f2a460b0ed348806f Mon Sep 17 00:00:00 2001
From: Timothy DeHerrera <tim.deh@pm.me>
Date: Mon, 28 Dec 2020 18:35:44 -0700
Subject: [PATCH 1/2] `nix run` is now `nix shell` semantically
---
bin/.any-nix-run-wrapper | 6 +++---
bin/any-nix-shell | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/bin/.any-nix-run-wrapper b/bin/.any-nix-run-wrapper
index 618ff14..db97319 100755
--- a/bin/.any-nix-run-wrapper
+++ b/bin/.any-nix-run-wrapper
@@ -10,7 +10,7 @@ fns () {
pos=$((pos-1))
elif [[ $arg == -* ]]; then
if [[ $arg == -c ]] || [[ $arg == --command ]]; then
- command nix run "$@"
+ command nix shell "$@"
return
elif [[ $arg == --arg ]] || [[ $arg == --argstr ]]; then
pos=2
@@ -27,6 +27,6 @@ fns () {
if [[ -n $name ]] && [[ $name != shell ]]; then
pkgs+=" "$name
fi
- env ANY_NIX_SHELL_PKGS="$pkgs" IN_NIX_RUN=1 nix run "$@" --command $which_shell
+ env ANY_NIX_SHELL_PKGS="$pkgs" IN_NIX_RUN=1 nix shell "$@" --command $which_shell
}
-fns "$@"
\ No newline at end of file
+fns "$@"
diff --git a/bin/any-nix-shell b/bin/any-nix-shell
index c8488fb..6af6e23 100755
--- a/bin/any-nix-shell
+++ b/bin/any-nix-shell
@@ -12,7 +12,7 @@ end
# Overwrite the nix command
function nix
- if test \$argv[1] = run
+ if test \$argv[1] = shell
set argv[1] fish
$(which .any-nix-run-wrapper) \$argv
else
@@ -51,7 +51,7 @@ function nix-shell () {
# Overwrite the nix command
function nix () {
- if [[ \$1 == run ]]; then
+ if [[ \$1 == shell ]]; then
shift
$(which .any-nix-run-wrapper) zsh "\$@"
else
--
2.29.2