- Removed the Stylix configuration from configuration.nix and created a new stylix.nix file for better organization.

- Enhanced ncli.nix to include generation information during NixOS rebuild and update commands.
- Updated niri.nix to include the new stylix module.
- Adjusted aliases to ensure correct path referencing.
- And some minor changes
This commit is contained in:
2025-11-26 11:14:22 +01:00
parent 74aa841812
commit a8a718a5ce
12 changed files with 700 additions and 56 deletions

View File

@ -125,7 +125,8 @@ in
;;
rebuild)
handle_backups
echo "Starting NixOS rebuild for current host: $HOST"
geno=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}')
echo "Starting NixOS rebuild for current host: $HOST on generation: $geno"
cd "$HOME/$PROJECT" || { echo "Error: Could not change to $HOME/$PROJECT"; exit 1; }
current=""
@ -133,14 +134,17 @@ in
current=$(cat /etc/nixos-tags)
fi
if sudo nixos-rebuild switch --flake ".#$HOST"; then
if sudo nixos-rebuild switch --flake .; then
echo " Rebuild finished successfully for $HOST"
if [ -n "$current" ]; then
sudo /run/current-system/specialisation/$current/bin/switch-to-configuration switch
sudo /run/current-system/specialisation/$current/bin/switch-to-configuration test
else
echo "No specialization tag found, staying on default system."
fi
genn=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}')
echo "Running on new generation: $geno -> $genn"
else
echo " Rebuild failed for $HOST" >&2
@ -149,7 +153,8 @@ in
;;
update)
handle_backups
echo "Updating flake and rebuilding system for current host: $HOST"
geno=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}')
echo "Updating flake and rebuilding system for current host: $HOST on generation: $geno"
cd "$HOME/$PROJECT" || { echo "Error: Could not change to $HOME/$PROJECT"; exit 1; }
echo "Updating flake..."
@ -172,7 +177,7 @@ in
echo "Rebuilding system... Staying on current specialization"
fi
if sudo nixos-rebuild switch --flake ".#$HOST"; then
if sudo nixos-rebuild switch --flake .; then
echo " Update and rebuild finished successfully for $HOST"
if [ -n "$current" ]; then
@ -181,6 +186,9 @@ in
echo "No specialization tag found, staying on default system."
fi
genn=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}')
echo "Running on new generation: $geno -> $genn"
else
echo " Update and rebuild failed for $HOST" >&2
exit 1