fix: Installer nutzt 'nix profile' statt nix-env wenn Profil inkompatibel
All checks were successful
Build AppImage / build (push) Has been skipped

Auf aktuellen NixOS-Systemen mit flakes ist das Default-Profil unter
~/.local/state/nix/profiles/profile inkompatibel mit nix-env. Der
Installer erkennt jetzt den Profil-Typ (nix profile list) und nutzt
den passenden Befehl (nix profile install / nix-env -i).
This commit is contained in:
Eduard Wisch 2026-04-20 17:00:06 +02:00
parent 2de88a2a22
commit 03e1ae527b

View file

@ -40,11 +40,22 @@ err() { echo "${RED}✗${RST} $*" >&2; exit 1; }
# --- 1. Voraussetzungen pruefen ------------------------------------------- # --- 1. Voraussetzungen pruefen -------------------------------------------
step "Voraussetzungen pruefen" step "Voraussetzungen pruefen"
for cmd in nix-build nix-env curl sha256sum; do for cmd in nix-build nix curl sha256sum; do
command -v "$cmd" >/dev/null || err "$cmd nicht installiert. Abbruch." command -v "$cmd" >/dev/null || err "$cmd nicht installiert. Abbruch."
done done
ok "Nix, curl, sha256sum vorhanden" ok "Nix, curl, sha256sum vorhanden"
# Profil-Typ erkennen: neues 'nix profile' (Default auf aktuellem NixOS mit
# flakes) oder altes 'nix-env'. Das Profil kann nur mit einem von beiden
# verwaltet werden — Mischbetrieb schlaegt fehl.
if nix profile list >/dev/null 2>&1; then
PROFILE_MODE="profile"
elif command -v nix-env >/dev/null 2>&1; then
PROFILE_MODE="env"
else
err "Weder 'nix profile' noch 'nix-env' verfuegbar. Abbruch."
fi
# jq ist auf Vanilla-NixOS nicht gesetzt — aus nixpkgs ziehen # jq ist auf Vanilla-NixOS nicht gesetzt — aus nixpkgs ziehen
if ! command -v jq >/dev/null; then if ! command -v jq >/dev/null; then
echo " ${YEL}!${RST} jq fehlt — hole aus nixpkgs" echo " ${YEL}!${RST} jq fehlt — hole aus nixpkgs"
@ -175,9 +186,18 @@ popd >/dev/null
ok "Paket gebaut: $RESULT" ok "Paket gebaut: $RESULT"
# --- 6. Ins User-Profil installieren -------------------------------------- # --- 6. Ins User-Profil installieren --------------------------------------
if [ "$PROFILE_MODE" = "profile" ]; then
step "Ins User-Profil installieren (nix profile)"
# Bestehende Installation entfernen (falls vorhanden) — Name ODER Index
nix profile remove claude-desktop 2>/dev/null \
|| nix profile remove '.*claude-desktop.*' 2>/dev/null \
|| true
nix profile install "$RESULT"
else
step "Ins User-Profil installieren (nix-env)" step "Ins User-Profil installieren (nix-env)"
nix-env --uninstall claude-desktop 2>/dev/null || true nix-env --uninstall claude-desktop 2>/dev/null || true
nix-env -i "$RESULT" nix-env -i "$RESULT"
fi
ok "claude-desktop im \$PATH verfuegbar" ok "claude-desktop im \$PATH verfuegbar"
# --- 7. Desktop-Datenbank refreshen --------------------------------------- # --- 7. Desktop-Datenbank refreshen ---------------------------------------