From f1933088da845c9d5f7d413ea3f9f05e5961b16b Mon Sep 17 00:00:00 2001 From: K9BFF Date: Tue, 11 Nov 2025 13:38:04 -0600 Subject: [PATCH] update --- README.md | 16 ++++++++-------- sysop | 14 +++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2517d47..fd6233c 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ now you can give it a shot by running `sysop -h` ### options: -| flag | function | -|------|------------------------| -|-r | rebuild | -|-u | upgrade | -|-d | garbage collection | -|-p | nix-shell installation | -|-h | help | -|-s | search | +| flag | function | +|------|----------------------------------| +|-r | rebuild and push dotfiles to git | +|-u | upgrade | +|-d | garbage collection | +|-p | nix-shell installation | +|-h | help | +|-s | search | diff --git a/sysop b/sysop index cab1579..65fe1fb 100755 --- a/sysop +++ b/sysop @@ -11,6 +11,8 @@ su_check() { fi } + + # inverse sudo check because i found a bug last night inv_su_check() { if [[ $EUID -ne 0 ]]; then @@ -22,17 +24,12 @@ inv_su_check() { } -git-push() { - update-dotfiles -} - # rebuild if [[ $1 == "-r" ]]; then - git-push - su_check - nixos-rebuild switch |& nom - + inv_su_check + update-dotfiles + sudo nixos-rebuild switch |& nom # upgrade @@ -45,7 +42,6 @@ elif [[ $1 == "-u" ]]; then # garbage collection elif [[ $1 == "-d" ]]; then su_check - # shellcheck disable=SC2162 read -p "sysop: garbage collection: are you sure? (y/N): " yesno if [[ ${yesno:0:1} == "y" ]]; then nix-collect-garbage -d |& nom