home-manager: use short -f instead of --fqdn

MacOS doesn't support the long-style `--fqdn` option to `hostname` that
was added by 1b589257f7.

Switch to short style `-f` that should be supported on every platform.
This commit is contained in:
Gaurav Juvekar 2024-05-30 12:35:07 -07:00 committed by GitHub
parent 29c69d9a46
commit 0eb314b4f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,7 +200,7 @@ function setFlakeAttribute() {
local name="$USER"
# Check FQDN, long, and short hostnames; long first to preserve
# pre-existing behaviour in case both happen to be defined.
for n in "$USER@$(hostname --fqdn)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do
for n in "$USER@$(hostname -f)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do
if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then
name="$n"
if [[ -v VERBOSE ]]; then