From 7c4cbc5a9754be219ba042eb96125e12fe10f679 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 6 Feb 2025 11:19:21 +0100 Subject: [PATCH] ns --- users/pbsds/home/default.nix | 2 -- users/pbsds/home/profiles/bashrc.d/nix-shell.sh | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 users/pbsds/home/profiles/bashrc.d/nix-shell.sh diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index 7ba2331..84acdfe 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -153,8 +153,6 @@ bin = "python -c 'import sys; sys.stdout.write(sys.stdin.read().strip())' | curl -is -X POST https://i.kuklef.se/upload -F content=@- -F expiration=10d | grep '^location:' | cut -d' ' -f2-"; denix = "sed -E 's@/nix/store/[^ /]+@@g'"; - - ns = "nix-shell -p"; }; home.enableNixpkgsReleaseCheck = true; diff --git a/users/pbsds/home/profiles/bashrc.d/nix-shell.sh b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh new file mode 100644 index 0000000..3ebbe41 --- /dev/null +++ b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh @@ -0,0 +1,8 @@ +function ns() { + args=() + for pkg in $@; do + args+=(nixpkgs#"$pkg") + done + >&2 echo + exec nix shell "${args[@]}" + export PATH=$(nix --extra-experimental-features "nix-command flakes" shell "${args[@]}" -c sh -c 'echo $PATH') +}