general upgrades and adds adb and ulauncher addon

This commit is contained in:
Menno van Leeuwen 2024-11-21 16:52:06 +01:00
parent c0ab3d1517
commit 0b523463f2
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
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

View File

@ -28,6 +28,15 @@ update() {
"$update_script" $@
}
upgrade() {
local upgrade_script="$DOTFILES_BIN/actions/upgrade.sh"
if [[ ! -x "$upgrade_script" ]]; then
printfe "%s\n" "red" "Error: Upgrade script not found or not executable"
return 1
fi
"$upgrade_script" $@
}
term() {
local term_script="$DOTFILES_BIN/actions/term.sh"
if [[ ! -x "$term_script" ]]; then
@ -114,6 +123,7 @@ main() {
# Parse commands
case "${1:-help}" in
update) shift; update "$@" ;;
upgrade) shift; upgrade "$@" ;;
help) shift; help "$@" ;;
term) shift; term "$@" ;;
secrets) shift; secrets "$@" ;;

View File

@ -1,7 +1,9 @@
Usage: dotf [OPTIONS] [ARGS]
update: Pull latest changes, and update symlinks and configurations.
update: Pull latest changes, and update symlinks and configurations
Also pulls latest nix channels and updates flakes to latest versions.
upgrade: Runs switch, flake variants for nix switch with upgrade and home-manager.
secrets: Encrypt and decrypt secrets.
auto-start: Start a set of pre-defined applications.
term: Shows the welcome message for the terminal.

View File

@ -16,8 +16,8 @@ config:
mennos-server: ~/dotfiles/config/gitconfig.mennos-server
mennos-desktop: ~/dotfiles/config/gitconfig.linux
mennos-gamingpc: ~/dotfiles/config/gitconfig.linux
mennos-laptop: ~/dotfiles/config/gitconfig.linux
homeserver-pc: ~/dotfiles/config/gitconfig.linux
macos: ~/dotfiles/config/gitconfig.macos
wsl: ~/dotfiles/config/gitconfig.wsl
target: ~/.gitconfig
@ -35,11 +35,6 @@ config:
vscode:
source: ~/dotfiles/vscode/settings.json
target: ~/.config/Code/User/settings.json
# Autostart
autostart:
source: ~/dotfiles/config/autostart
target: ~/.config/autostart
# SSH config
ssh:

View File

@ -23,11 +23,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1730327045,
"narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
"lastModified": 1731797254,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"type": "github"
},
"original": {
@ -39,11 +39,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {

View File

@ -21,6 +21,7 @@
[
# General packages
git
onefetch
gnupg
gh
nixfmt-rfc-style

View File

@ -3,7 +3,7 @@
home.packages = with pkgs; [
# GUI Application
## Utilities
pkgs-unstable.mission-center # Task Manager like Windows 11
mission-center # Task Manager like Windows 11
gnome.gnome-tweaks
pinta # Paint.NET alternative
bottles # Wine manager

View File

@ -108,6 +108,7 @@ in
# https://ext.ulauncher.io/-/github-tchar-ulauncher-albert-calculate-anything
# https://ext.ulauncher.io/-/github-isacikgoz-ukill
# https://ext.ulauncher.io/-/github-iboyperson-ulauncher-system
# https://github.com/IgorVaryvoda/ulauncher-perplexity
{
nixpkgs.overlays = [
(final: prev: { ulauncher = prev.ulauncher.override { python3 = pythonWithPackages; }; })

View File

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"lastModified": 1731797254,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"type": "github"
},
"original": {
@ -18,11 +18,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {

View File

@ -2,6 +2,7 @@
{
imports = [ ./virtualisation.nix ];
programs.adb.enable = true;
environment.systemPackages = with pkgs; [
yubikey-manager
trash-cli

View File

@ -14,6 +14,7 @@
"video"
"render"
"users"
"adbusers"
];
};
}

View File

@ -1,9 +1,9 @@
-----BEGIN PGP MESSAGE-----
jA0ECQMI71xa/M78CPH/0sABAWePpHsecx8nyyOTGKuQGT2gXkYLPDnYZ+tZRCWX
YTGatN0+/jGc+5aluZfIZxJ7ukR+Fv+0DmdiWLHD/tNZsCvhYv5ULUjqW4uZWxsZ
dnS6AnvYYVKPd8g9RopIh/gKQpEnMWZkD1LQ/xrXByMBS/yn+MZ6cwV33k7lWC3x
qGlpdk9nmmTdEdEW8Jcby1izrNFzrOhMVxmokZ96q3S+/9gzJs9awdNoCqMhG7mR
7BeCD7ljyg8rvFkQyccrdUOQPQ==
=blvW
jA0ECQMI1/r+VnIxlUT/0sAKAQjTxJQbnn7OWukMK79HYhm5Rdui20re6P8xvsGt
O72UQWPsYQRQOHKXd330WH4mOX6gY/kGzVfXz8MgjNVvHTt01Bycd0HZx3jNmFlc
KLMDyCzxlO1lqD/4u/0UjW4fCMgFH3FMok2FJeudM1GTd+ltwulrx+3aOZWh4taK
X+HM3XcaDTunk/DMTh8P/zckWOc1Ng6VgFeDYbbiKGNdsZCnxGscnNctAKiVpSFW
IE1Z+RKgEpMa+xLCQfwheJKlX/UwMZVHjAoQ9A==
=D8Oy
-----END PGP MESSAGE-----