refactor hostname preparation to check for NixOS only when hardware configuration is absent
All checks were successful
Nix Format Check / check-format (push) Successful in 39s
All checks were successful
Nix Format Check / check-format (push) Successful in 39s
This commit is contained in:
parent
c11c4e7482
commit
d48a3d3925
3
setup.sh
3
setup.sh
@ -353,6 +353,8 @@ prepare_hostname() {
|
|||||||
local hostname_file="$HOME/.hostname"
|
local hostname_file="$HOME/.hostname"
|
||||||
local hostname
|
local hostname
|
||||||
|
|
||||||
|
# Only check for NixOS if hardware configuration is not found
|
||||||
|
if command -v nixos-version >/dev/null 2>&1; then
|
||||||
if [ -f "$hostname_file" ]; then
|
if [ -f "$hostname_file" ]; then
|
||||||
hostname=$(cat "$hostname_file")
|
hostname=$(cat "$hostname_file")
|
||||||
log_success "Hostname already found in $hostname_file. Using $hostname."
|
log_success "Hostname already found in $hostname_file. Using $hostname."
|
||||||
@ -364,6 +366,7 @@ prepare_hostname() {
|
|||||||
log_success "Hardware configuration found for $hostname. Continuing setup..."
|
log_success "Hardware configuration found for $hostname. Continuing setup..."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure interactive input before hostname prompt
|
# Ensure interactive input before hostname prompt
|
||||||
ensure_interactive
|
ensure_interactive
|
||||||
|
Loading…
x
Reference in New Issue
Block a user