adding yacreader

This commit is contained in:
2025-10-12 16:09:41 -05:00
parent b89c6a14cc
commit abcad5c9f2
5 changed files with 32 additions and 24 deletions

View File

@@ -1,13 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
echo "searching generations"
# your hostname (flake target)
hostname="$(hostname)"
old_gen=$(nixos-rebuild list-generations | grep current | awk '{print $1}')
gen=$((old_gen + 1))
echo "gen $old_gen --> gen $gen"
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
nix_dir="$HOME/.nix"
logfile="$nix_dir/.nixos-switch-log"
pushd "$nix_dir" >/dev/null
# function to get current nixos generation
@@ -17,6 +21,8 @@ get_current_generation() {
echo "diffs:"
git diff
echo ""
echo "files:"
git status --short
read -rp "commit message: " commit_msg
echo "rebuilding nixos with flake.nix..."