(desktop) Gen 490: split nixcommit into two scripts, one for committing one for pushing. also renamed nixswitch to rebuild

This commit is contained in:
pagedMov
2024-10-15 18:55:49 -04:00
parent 835732e9e0
commit e3ac2e4f63
5 changed files with 51 additions and 11 deletions

View File

@@ -0,0 +1,24 @@
{ self, pkgs }:
pkgs.writeShellScriptBin "nixpush" (''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -z "$commits" ]; then
scheck && runbg aplay ${self}/media/sound/warning.wav
echo "Nothing to push"
exit
fi
echo "Pushing the following commits upstream on branch '$(git branch | rg "\*" | awk '{print $2}')'"
echo "$commits"
git push
scheck && runbg aplay ${self}/media/sound/gitpush.wav
popd
'')