Files
Nomarchy/bin/system/nomarchy-setup-dns
Bernardo Magri 514b305713 feat(system): comprehensive branding, styling, and system feature update
- Relocate themes to assets/themes/ and update all references.
- Implement custom SDDM theme and Plymouth theme enhancements.
- Add themed templates for Alacritty, Hyprland, Waybar, and other apps.
- Introduce Makima key remapper module and configuration.
- Add Voxtype and Walker configurations.
- Implement systemd power management and timeout optimizations.
- Add Nautilus-python extensions for LocalSend.
- Update branding assets and ASCII art integration.
2026-04-05 10:52:41 +01:00

36 lines
941 B
Bash
Executable File

#!/usr/bin/env bash
# Configure DNS declaratively for Nnomarchy NixOS.
# Hybrid: updates /etc/nixos/state.json and runs sys-update.
STATE_FILE="/etc/nixos/state.json"
if [[ -z $1 ]]; then
dns=$(gum choose --height 6 --header "Select DNS provider" Cloudflare Google DHCP Custom)
else
dns=$1
fi
case "$dns" in
Cloudflare|Google|DHCP)
sudo jq ".dns = \"$dns\"" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE"
;;
Custom)
echo "Enter your DNS servers (space-separated, e.g. '192.168.1.1 1.1.1.1'):"
read -r dns_servers
if [[ -z $dns_servers ]]; then
echo "Error: No DNS servers provided."
exit 1
fi
# Convert to JSON array
dns_array=$(echo "$dns_servers" | jq -R 'split(" ")')
sudo jq ".dns = \"Custom\" | .customDns = $dns_array" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE"
;;
esac
echo "DNS configured to $dns. Applying changes..."
sudo sys-update