From f66308c6f3cd3df44ecade19f1a8a72e19d7eb85 Mon Sep 17 00:00:00 2001 From: Szymon P Date: Wed, 29 Apr 2026 17:31:16 +0200 Subject: [PATCH] feat: topgrade --- modules/cli/fish.nix | 167 ++++++++++++++++++++------------------- modules/cli/topgrade.nix | 4 +- 2 files changed, 87 insertions(+), 84 deletions(-) diff --git a/modules/cli/fish.nix b/modules/cli/fish.nix index 3a58cde..171368d 100644 --- a/modules/cli/fish.nix +++ b/modules/cli/fish.nix @@ -107,99 +107,99 @@ }; - update = { - body = - if userConfig.isNixOS then - # fish - '' - echo "=== System packages update ===" - pushd /etc/nixos + # update = { + # body = + # if userConfig.isNixOS then + # # fish + # '' + # echo "=== System packages update ===" + # pushd /etc/nixos - if git pull - git add -A - git commit --allow-empty -m "chore: state before system update" - - nix flake update - - if test $status -eq 0 - git add ./flake.lock - git commit --allow-empty -m "chore: update system flake.lock" - reload_system - git push - else - echo "Error while updating system flake!" - end - else - echo "Error: 'git pull' failed in /etc/nixos. Skipping system update." - end + # if git pull + # git add -A + # git commit --allow-empty -m "chore: state before system update" + # + # nix flake update + # + # if test $status -eq 0 + # git add ./flake.lock + # git commit --allow-empty -m "chore: update system flake.lock" + # reload_system + # git push + # else + # echo "Error while updating system flake!" + # end + # else + # echo "Error: 'git pull' failed in /etc/nixos. Skipping system update." + # end - popd + # popd - echo "=== User packages update ===" - pushd $HOME/.config/home-manager + # echo "=== User packages update ===" + # pushd $HOME/.config/home-manager - if git pull - git add -A - git commit --allow-empty -m "chore: state before home-manager update" - - nix flake update - - if test $status -eq 0 - git add ./flake.lock - git commit --allow-empty -m "chore: update home flake.lock" - git push - reload_dotfiles - else - echo "Error while updating home flake!" - end - else - echo "Error: 'git pull' failed in home-manager. Skipping user update." - end + # if git pull + # git add -A + # git commit --allow-empty -m "chore: state before home-manager update" + # + # nix flake update + # + # if test $status -eq 0 + # git add ./flake.lock + # git commit --allow-empty -m "chore: update home flake.lock" + # git push + # reload_dotfiles + # else + # echo "Error while updating home flake!" + # end + # else + # echo "Error: 'git pull' failed in home-manager. Skipping user update." + # end - popd + # popd - if type -q flatpak - echo "=== Flatpak update ===" - flatpak update --noninteractive - - echo "=== Flatpak remove unused ===" - flatpak uninstall --unused --noninteractive - end - '' - else - # fish - '' - echo "===System update===" + # if type -q flatpak + # echo "=== Flatpak update ===" + # flatpak update --noninteractive + # + # echo "=== Flatpak remove unused ===" + # flatpak uninstall --unused --noninteractive + # end + # '' + # else + # # fish + # '' + # echo "===System update===" - if not type -q yay - echo "Yay not found… Please consider installing it!" - else - yay - end + # if not type -q yay + # echo "Yay not found… Please consider installing it!" + # else + # yay + # end - if type -q pacman - echo "===Remove orphans===" - set orphans (pacman -Qtdq) - if test (count $orphans) -gt 0 - sudo pacman -Rns $orphans - end - end + # if type -q pacman + # echo "===Remove orphans===" + # set orphans (pacman -Qtdq) + # if test (count $orphans) -gt 0 + # sudo pacman -Rns $orphans + # end + # end - if type -q flatpak - echo "===Flatpak update===" - flatpak update --noninteractive - echo "===Flatpak remove unused===" - flatpak uninstall --unused - end + # if type -q flatpak + # echo "===Flatpak update===" + # flatpak update --noninteractive + # echo "===Flatpak remove unused===" + # flatpak uninstall --unused + # end - if type -q nix-channel - echo "===Nix update===" - nix-channel --update - echo "===Nix garbage collection===" - home-manager expire-generations "-7 days" - end - ''; - }; + # if type -q nix-channel + # echo "===Nix update===" + # nix-channel --update + # echo "===Nix garbage collection===" + # home-manager expire-generations "-7 days" + # end + # ''; + # }; blog_build_and_push = { body = @@ -224,6 +224,7 @@ ls = "eza --long --icons --group-directories-first --git"; lst = "eza --long --icons --color --git --tree"; rm = "trash"; + update = "topgrade"; }; }; } diff --git a/modules/cli/topgrade.nix b/modules/cli/topgrade.nix index 1cdb41b..4f96d96 100644 --- a/modules/cli/topgrade.nix +++ b/modules/cli/topgrade.nix @@ -16,7 +16,9 @@ in "node" "hyprpm" ]; - cleanup = true; + cleanup = false; + notify_end = "never"; + nix_handle = "nh"; }; git = {