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)" eval "$(direnv hook bash)"
''; '';
shellAliases = { 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"; "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() { function nxr() {
set -u set -u
local pkg="" local pkg=""
local bin="" local bin=""
local count=0 local count=0
for var in "$@"; do
if [ "$var" == "--" ]; then
count=$((count + 1))
break
fi
# for var in "$@" if [ "$count" == "0" ]; then
# do pkg="$var"
# if [ "$var" == "--" ]; then fi
# shift "$count"
# fi
# done
local pkg="$1" if [ "$count" == "1" ]; then
local bin="$2" bin="$var"
fi
if [ -z "$bin" ]; then count=$((count + 1))
bin="$pkgs" done
shift $count
if [ -z "$pkg" ]; then
echo "Error: no pkg name given"
exit 1
fi fi
shift if [ -z "$bin" ]; then
nix-shell -p "$pkg" --run "$bin $@" 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 set +u
} }

View File

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

View File

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