feat: added more logging to commands

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-04-09 13:27:10 -03:00
parent 78659c41c0
commit f2dff2cf9d

View File

@@ -107,6 +107,8 @@ function nih-switch () {
pushd $flake_dir
gum log --structured --prefix 'nih switch' --level info 'Switching NixOS config'
gum log --structured --prefix 'nih switch' --level debug 'Adding decrypted secret files'
git add ./secrets/*.decrypted.*
@@ -133,6 +135,11 @@ function nih-switch () {
gum log --structured --prefix 'nih switch' --level debug 'Removing decrypted secret files'
git reset ./secrets/*.decrypted.*
gum log --structured --prefix 'nih edit' --level info 'NixOS rebuilt!'
notify-send -e "NixOS Rebuilt!" \
--icon=software-update-available \
--urgency=low
popd
}
@@ -148,7 +155,13 @@ function nih-install() {
index=$(($index + 1))
done
shift $index
gum log --structured --prefix 'nih install' --level info "Temporaly installing to current shell:"
gum log --structured --prefix 'nih install' --level info "${pkgs[@]}"
nix shell "${pkgs[@]}" "$@"
gum log --structured --prefix 'nih install' --level info "Packages intalled!"
}
function nih-execute() {