From 53bc8f23903af7f0b947b72f40962f6b43360d03 Mon Sep 17 00:00:00 2001 From: pagedMov Date: Thu, 10 Oct 2024 18:28:26 -0400 Subject: [PATCH] Gen 277: rewrote zshell.nix, split nixswitch into two separate functions --- .zsh_history | 6 ++++++ glasshouse-desktop/home/zsh/.zsh_history | 4 ++++ glasshouse-desktop/home/zsh/zshell.nix | 21 ++++++--------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.zsh_history b/.zsh_history index b871571..3580786 100644 --- a/.zsh_history +++ b/.zsh_history @@ -12,3 +12,9 @@ : 1728597285:0;zsr : 1728598374:0;typeset -f cd : 1728598390:0;cd ~/dots +: 1728599232:0;nvim zshell.nix +: 1728599235:0;zrc +: 1728599261:0;nixswitch +: 1728599299:0;nixcommit "rewrote zshell.nix, split nixswitch into two separate functions" +: 1728599303:0;zsr +: 1728599304:0;nixcommit "rewrote zshell.nix, split nixswitch into two separate functions" diff --git a/glasshouse-desktop/home/zsh/.zsh_history b/glasshouse-desktop/home/zsh/.zsh_history index df18d8f..620b793 100644 --- a/glasshouse-desktop/home/zsh/.zsh_history +++ b/glasshouse-desktop/home/zsh/.zsh_history @@ -45,3 +45,7 @@ : 1728599083:0;nixswitch : 1728599116:0;zsr : 1728599118:0;nixcommit +: 1728599131:0;nvim zshell.nix +: 1728599192:0;nixswitch +: 1728599212:0;zsr +: 1728599222:0;nixcommit "rewrote zshell.nix" diff --git a/glasshouse-desktop/home/zsh/zshell.nix b/glasshouse-desktop/home/zsh/zshell.nix index 8df0fe4..86d9ea3 100644 --- a/glasshouse-desktop/home/zsh/zshell.nix +++ b/glasshouse-desktop/home/zsh/zshell.nix @@ -93,22 +93,13 @@ nixcommit() { gen=$((gen + 1)) git diff --quiet - if [ $? -eq 1 ]; then - git add . - git commit -m "Gen $gen: $@" - git push + if [ $? -eq 0 ]; then + echo "Nothing to commit" + return fi - - read -p "Rebuild? y/n" confirm - if [ confirm = "y" ]; then - sudo nixos-rebuild switch --flake "$HOME/sysflakes#glasshouse" - if [ $? -eq 0 ]; then - s_check && (aplay ~/sound/sys/update.wav > /dev/null 2>&1 &) - else - s_check && (aplay ~/sound/sys/error.wav > /dev/null 2>&1 &) - fi - fi - builtin cd $OLDPWD + git add . + git commit -m "Gen $gen: $@" + git push } nixswitch() {