generation 580 25.11.20250714.62e0f05
This commit is contained in:
26
home/scripts/nix-diff.sh
Normal file
26
home/scripts/nix-diff.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# shows what changed between the current and previous NixOS generation
|
||||
|
||||
PROFILE="/nix/var/nix/profiles/system"
|
||||
|
||||
# current generation number from the profile symlink (e.g. system-185-link)
|
||||
current_gen=$(readlink "$PROFILE" | grep -oP '\d+')
|
||||
prev_gen=$((current_gen - 1))
|
||||
|
||||
current=$(readlink -f "${PROFILE}-${current_gen}-link")
|
||||
previous=$(readlink -f "${PROFILE}-${prev_gen}-link")
|
||||
|
||||
if [ ! -e "${PROFILE}-${prev_gen}-link" ]; then
|
||||
echo "Previous generation ($prev_gen) not found (garbage collected?)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\033[1mGen $prev_gen:\033[0m $previous"
|
||||
echo -e "\033[1mGen $current_gen:\033[0m $current"
|
||||
echo
|
||||
|
||||
if command -v nvd &>/dev/null; then
|
||||
nvd diff "$previous" "$current"
|
||||
else
|
||||
nix store diff-closures "$previous" "$current"
|
||||
fi
|
||||
1
home/scripts/ptop.sh
Normal file
1
home/scripts/ptop.sh
Normal file
@@ -0,0 +1 @@
|
||||
ps -eo pid=,%cpu=,comm= --sort=-%cpu | awk '$3 != "ps"' | head -n 5 | while read p c n; do printf "\n\033[1;31m[ %s%% CPU ]\033[0m \033[1m%s\033[0m (PID: %s)\n" "$c" "$n" "$p"; pstree -g 3 -w -p "$p" | sed -E 's#/nix/store/[a-z0-9]{32}-##g; s#/etc/profiles/per-user/synchronous/bin/##g; s#/run/current-system/systemd/lib/##g' | cut -c 1-$COLUMNS; done
|
||||
Reference in New Issue
Block a user