shell functions for running and creating shells
This commit is contained in:
parent
21fe9aee0e
commit
1e0dc4783f
|
@ -21,6 +21,27 @@
|
|||
initExtra = ''
|
||||
source ~/.profile
|
||||
set -o vi
|
||||
|
||||
run() {
|
||||
pkg="$1"
|
||||
[ "$pkg" = "''${pkg##*#}" ] && pkg="nixpkgs#$pkg"
|
||||
export NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_BROKEN=1
|
||||
nix run --impure "$pkg"
|
||||
}
|
||||
|
||||
shell() {
|
||||
i="$#"
|
||||
while [ "$i" -gt 0 ]; do
|
||||
pkg="$1"
|
||||
[ "$pkg" = "''${pkg##*#}" ] && pkg="nixpkgs#$pkg"
|
||||
shift
|
||||
set -- "$@" "$pkg"
|
||||
: $(( i -= 1 ))
|
||||
done
|
||||
export NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_BROKEN=1
|
||||
nix shell --impure "$@"
|
||||
}
|
||||
|
||||
'';
|
||||
};
|
||||
programs.direnv = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user