nexoniarz-config-nixos-laptop/modules/scripts/hotspot-start.sh
Nexoniarz 6bcd5e15ad Switch desktop environment from Hyprland to Pantheon
Configures Pantheon (LightDM + gala) for daily use on this ASUS TUF
Gaming A15 (FA507NU), and drops everything that only existed to serve
the previous Hyprland/Quickshell setup:

- desktop.nix: services.desktopManager.pantheon instead of
  programs.hyprland + greetd; comfy laptop touchpad defaults.
- drivers.nix: NVIDIA PRIME render offload between the AMD Radeon 680M
  (drives the panel) and the RTX 4050 Max-Q (offload-only), using this
  machine's real PCI bus IDs; asusd/supergfxd for ASUS-specific laptop
  control.
- apps.nix / scripts.nix: removed Hyprland/Quickshell-only packages and
  scripts (kitty, rofi, quickshell, mako, hyprlock, hyprpaper/mpvpaper,
  the Quickshell theme-picker scripts, cursor/wallpaper/display
  helpers) — Pantheon ships its own Files/Terminal/Screenshot/
  notifications/theming natively. Kept the DE-agnostic scripts (vault
  toggle, metadata stripping, brightness control, Wi-Fi hotspot,
  telemetry, weather).
- theme.nix and default-apps.nix deleted entirely — Pantheon owns
  GTK/icon theming itself, no more live dconf/CSS generation pipeline
  needed.
- Deleted hyprland/ and dotfiles/ (kitty, mako, quickshell, rofi).

Verified with `nixos-rebuild build`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RpiovBQL6k5MTDMN3Ln9nL
2026-08-31 19:52:59 +02:00

33 lines
1.2 KiB
Shell
Executable file

#!/usr/bin/env bash
# Starts a Wi-Fi hotspot with explicit security/band control — the simple
# `nmcli device wifi hotspot` one-liner doesn't expose those.
# hotspot-start <ssid> <password> <wpa2|wpa3> <auto|bg|a>
set -euo pipefail
ssid="${1:?usage: hotspot-start <ssid> <password> <wpa2|wpa3> <auto|bg|a>}"
password="${2:?password required}"
security="${3:-wpa2}"
band="${4:-auto}"
iface=$(nmcli -t -f DEVICE,TYPE device | awk -F: '$2=="wifi"{print $1; exit}')
if [ -z "$iface" ]; then
echo "No Wi-Fi device found" >&2
exit 1
fi
# Idempotent: drop any previous Hotspot profile from an earlier run first.
nmcli connection delete Hotspot >/dev/null 2>&1 || true
key_mgmt="wpa-psk"
[ "$security" = "wpa3" ] && key_mgmt="sae"
nmcli connection add type wifi ifname "$iface" con-name Hotspot autoconnect no ssid "$ssid" > /dev/null
nmcli connection modify Hotspot 802-11-wireless.mode ap
if [ "$band" != "auto" ]; then
nmcli connection modify Hotspot 802-11-wireless.band "$band"
fi
nmcli connection modify Hotspot wifi-sec.key-mgmt "$key_mgmt"
nmcli connection modify Hotspot wifi-sec.psk "$password"
nmcli connection modify Hotspot ipv4.method shared
nmcli connection up Hotspot