general upgrades and adds adb and ulauncher addon

This commit is contained in:
2024-11-21 16:52:06 +01:00
parent c0ab3d1517
commit 0b523463f2
13 changed files with 58 additions and 47 deletions

View File

@@ -92,27 +92,28 @@ symlinks() {
done
}
sys_packages_upgrade() {
printfe "%s\n" "cyan" "Running NixOS channel update..."
sudo nix-channel --update
printfe "%s\n" "cyan" "Upgrading NixOS packages..."
cd $HOME/dotfiles/config/nixos && sudo nixos-rebuild switch --upgrade --flake .#$DOTF_HOSTNAME --impure
}
####################################################################################################
# Update packages
####################################################################################################
sys_packages() {
printfe "%s\n" "cyan" "Updating system packages..."
if [[ "$OSTYPE" == "darwin"* ]]; then
printfe "%s\n" "cyan" "Updating brew packages..."
brew update
brew upgrade
brew cleanup
else
if [ -x "$(command -v nixos-version)" ]; then
cd $HOME/dotfiles/config/nixos && sudo nixos-rebuild switch --flake .#$DOTF_HOSTNAME --impure
printfe "%s\n" "cyan" "Updating nix channels..."
printfe "%s" "cyan" "System channels: "
sudo -i nix-channel --update
printfe "%s" "cyan" "User channels: "
nix-channel --update
printfe "%s\n" "cyan" "Updating nixos flake..."
cd $HOME/dotfiles/config/nixos && nix flake update
# Exit if this failed
if [ $? -ne 0 ]; then
@@ -121,6 +122,7 @@ sys_packages() {
return
fi
printfe "%s\n" "cyan" "Updating apt packages..."
sudo nala upgrade -y
sudo nala autoremove -y --purge
fi
@@ -160,15 +162,8 @@ flatpakpkgs() {
}
homemanager() {
printfe "%s\n" "cyan" "Running Home Manager update..."
# Due to weirdness delete this file if it exists
if [ -f "$HOME/.config/mimeapps.list.backup" ]; then
echo "Removing mimeapps.list.backup"
rip "$HOME/.config/mimeapps.list.backup"
fi
cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager switch -b backup --flake .#$DOTF_HOSTNAME --impure
printfe "%s\n" "cyan" "Updating Home Manager flake..."
cd $HOME/dotfiles/config/home-manager && nix flake update
}
####################################################################################################
@@ -188,9 +183,6 @@ if [ "$#" -eq 0 ]; then
else
for arg in "$@"; do
case $arg in
--nixos-upgrade)
sys_packages_upgrade
;;
--nixos|nixos|nix|nixos-rebuild)
sys_packages
;;

8
bin/actions/upgrade.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
printfe "%s\n" "cyan" "Upgrading NixOS packages..."
cd $HOME/dotfiles/config/nixos && sudo nixos-rebuild switch --upgrade --flake .#$DOTF_HOSTNAME --impure
printfe "%s\n" "cyan" "Upgrading Home Manager packages..."
cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager switch -b backup --flake .#$DOTF_HOSTNAME --impure