(desktop) Gen 494: reformatted several files using alejandra

This commit is contained in:
pagedMov
2024-10-15 20:16:32 -04:00
parent 1441353258
commit bd1add14bb
98 changed files with 6440 additions and 3256 deletions

View File

@@ -1,46 +1,49 @@
{ self, pkgs, host}:
{
self,
pkgs,
host,
}:
pkgs.writeShellScriptBin "nixcommit" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
pkgs.writeShellScriptBin "nixcommit" (''
#!/run/current-system/sw/bin/bash
if [ -n "$2" ]; then
echo "too many arguments"
exit
fi
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
diffcheck=$(git status | grep "working tree clean")
if [ -n "$diffcheck" ]; then
scheck && runbg aplay ${self}/media/sound/warning.wav
echo "Nothing to commit"
exit
fi
if [ -n "$2" ]; then
echo "too many arguments"
exit
fi
alejandra . &> /dev/null
git add .
diffcheck=$(git status | grep "working tree clean")
if [ -n "$diffcheck" ]; then
scheck && runbg aplay ${self}/media/sound/warning.wav
echo "Nothing to commit"
exit
fi
# Automatic fixup commit to the most recent commit (HEAD~1)
if [ -z "$1" ]; then
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -n "$commits" ]; then
git commit --fixup HEAD
echo "No commit message given"
echo "Squashing into most recent commit"
git rebase --autosquash master
else
echo "No prior local commits to squash into, please provide a commit message"
exit
fi
else
# Generate the system generation number
gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/')
gen=$((gen + 1))
git commit -m "(${host}) Gen $gen: $1"
fi
git add .
# Automatic fixup commit to the most recent commit (HEAD~1)
if [ -z "$1" ]; then
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -n "$commits" ]; then
git commit --fixup HEAD
echo "No commit message given"
echo "Squashing into most recent commit"
git rebase --autosquash master
else
echo "No prior local commits to squash into, please provide a commit message"
exit
fi
else
# Generate the system generation number
gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/')
gen=$((gen + 1))
git commit -m "(${host}) Gen $gen: $1"
fi
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
builtin cd - || exit
'')
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
builtin cd - || exit
''