thelio76: bash

This commit is contained in:
Alex 2024-08-11 21:15:17 -04:00
parent 201721ff72
commit f96268c640
4 changed files with 36 additions and 14 deletions

View File

@ -8,6 +8,8 @@
eval "$(direnv hook bash)"
'';
shellAliases = {
"quick-switch-c" = "cd ~/Git/nixos-config; ./quick-switch.sh -c";
"quick-switch" = "cd ~/Git/nixos-config; ./quick-switch.sh";
"git-override" = "git add . && git commit --amend --no-edit && git push --force-with-lease";
};
};

View File

@ -1,25 +1,45 @@
# shellcheck disable=SC2148
function nxr() {
set -u
local pkg=""
local bin=""
local count=0
# for var in "$@"
# do
# if [ "$var" == "--" ]; then
# shift "$count"
# fi
# done
local pkg="$1"
local bin="$2"
if [ -z "$bin" ]; then
bin="$pkgs"
for var in "$@"; do
if [ "$var" == "--" ]; then
count=$((count + 1))
break
fi
shift
nix-shell -p "$pkg" --run "$bin $@"
if [ "$count" == "0" ]; then
pkg="$var"
fi
if [ "$count" == "1" ]; then
bin="$var"
fi
count=$((count + 1))
done
shift $count
if [ -z "$pkg" ]; then
echo "Error: no pkg name given"
exit 1
fi
if [ -z "$bin" ]; then
bin="$pkg"
fi
echo "Running nxr with:"
printf "\tpkg=%s" "$pkg"
printf "\tbin=%s" "$bin"
printf "\topts=%s" "$@"
printf "\n\n"
nix-shell -p "$pkg" --run "$bin $*"
set +u
}

View File

@ -1,6 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
shellcheck
shfmt # for shell-format extension
];
programs.vscode = {

View File

@ -8,8 +8,7 @@ in
backend = "glx";
activeOpacity = 1;
inactiveOpacity = 0.75;
# shadow = true;
inactiveOpacity = 1;
vSync = true;
settings = {