feat(system): professionalize system configurations
- Consolidate imperative system settings into /etc/nixos/state.json - Implement nomarchy.system options for DNS, Wifi powersave, Timezone, and hardware features - Add declarative browser policies for Chromium/Brave based on theme - Update toggles scripts to mutate system JSON and run sys-update --impure - Remove obsolete imperative browser theme and redundant system modules
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
#!/bin/bash
|
||||
for iface in /sys/class/net/*/wireless; do
|
||||
iface="$(basename "$(dirname "$iface")")"
|
||||
iw dev "$iface" set power_save "$1" 2>/dev/null
|
||||
done
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Toggles wifi power saving declaratively.
|
||||
# Usage: nomarchy-wifi-powersave <on|off>
|
||||
|
||||
STATE_FILE="/etc/nixos/state.json"
|
||||
|
||||
case "$1" in
|
||||
on) value="true" ;;
|
||||
off) value="false" ;;
|
||||
*) echo "Usage: nomarchy-wifi-powersave <on|off>"; exit 1 ;;
|
||||
esac
|
||||
|
||||
sudo jq ".wifi.powersave = $value" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE"
|
||||
|
||||
echo "Wifi powersave set to $1. Applying changes..."
|
||||
sudo sys-update
|
||||
|
||||
Reference in New Issue
Block a user