fix: dynamic flake path resolution and replace env-update/sys-update aliases with scripts

This commit is contained in:
Bernardo Magri
2026-04-13 13:25:54 +01:00
parent 866e556656
commit 9746e75bc5
18 changed files with 56 additions and 33 deletions

View File

@@ -5,8 +5,18 @@
set -e
# Detect the repository location
if [ -f "/etc/nixos/flake.nix" ]; then
REPO_DIR="/etc/nixos"
elif [ -f "/etc/nomarchy/flake.nix" ]; then
REPO_DIR="/etc/nomarchy"
else
echo "Error: Nomarchy flake repository not found in /etc/nixos or /etc/nomarchy."
exit 1
fi
# Apply NixOS changes from the local flake
echo "Applying system-level changes..."
sudo nixos-rebuild switch --flake /etc/nixos#default --impure
echo "Applying system-level changes from $REPO_DIR..."
sudo nixos-rebuild switch --flake "$REPO_DIR#default" --impure
echo "System update complete."