mob next [ci-skip] [ci skip] [skip ci]
lastFile:flake.nix
This commit is contained in:
@@ -103,55 +103,64 @@
|
|||||||
# include files in the images.
|
# include files in the images.
|
||||||
# to set UCI configuration, create a uci-defauts scripts as per
|
# to set UCI configuration, create a uci-defauts scripts as per
|
||||||
# official OpenWRT ImageBuilder recommendation.
|
# official OpenWRT ImageBuilder recommendation.
|
||||||
files = pkgs.runCommand "image-files" { } ''
|
files =
|
||||||
|
let
|
||||||
|
router-config = {
|
||||||
|
upstream-wifi = {
|
||||||
|
ssid = "Glom";
|
||||||
|
password = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.runCommand "image-files" { } ''
|
||||||
|
|
||||||
mkdir -p $out/etc/uci-defaults
|
mkdir -p $out/etc/uci-defaults
|
||||||
cat > $out/etc/uci-defaults/99-custom <<EOF
|
cat > $out/etc/uci-defaults/99-custom <<EOF
|
||||||
uci -q batch << EOI
|
uci -q batch << EOI
|
||||||
set system.@system[0].hostname='flint'
|
set system.@system[0].hostname='flint'
|
||||||
commit
|
commit
|
||||||
EOI
|
EOI
|
||||||
|
|
||||||
# # Add a new wifi-iface for the upstream network (station mode)
|
# Add a new wifi-iface for the upstream network (station mode)
|
||||||
# uci set wireless.wwan=wifi-iface
|
uci set wireless.wwan=wifi-iface
|
||||||
# uci set wireless.wwan.device='radio0' # or radio1 for 5GHz
|
uci set wireless.wwan.device='radio0' # or radio1 for 5GHz
|
||||||
# uci set wireless.wwan.mode='sta'
|
uci set wireless.wwan.mode='sta'
|
||||||
# uci set wireless.wwan.network='wwan'
|
uci set wireless.wwan.network='wwan'
|
||||||
# uci set wireless.wwan.ssid='Glom'
|
uci set wireless.wwan.ssid='${router-config.upstream-wifi.ssid}'
|
||||||
# uci set wireless.wwan.encryption='psk2' # use 'psk' for WPA, 'none' for open
|
uci set wireless.wwan.encryption='psk2' # use 'psk' for WPA, 'none' for open
|
||||||
# uci set wireless.wwan.key='a'
|
uci set wireless.wwan.key='${router-config.upstream-wifi.password}'
|
||||||
# uci commit wireless
|
uci commit wireless
|
||||||
#
|
|
||||||
# uci set network.wwan=interface
|
|
||||||
# uci set network.wwan.proto='dhcp'
|
|
||||||
# uci commit network
|
|
||||||
#
|
|
||||||
# uci set network.relay=interface
|
|
||||||
# uci set network.relay.proto='relay'
|
|
||||||
# uci set network.relay.network='lan wwan' # bridges LAN and upstream
|
|
||||||
# uci commit network
|
|
||||||
#
|
|
||||||
# # Edit the existing AP or add a new one:
|
|
||||||
# uci set wireless.default_radio0.ssid='YourRepeaterSSID'
|
|
||||||
# uci set wireless.default_radio0.encryption='psk2'
|
|
||||||
# uci set wireless.default_radio0.key='YourRepeaterPassword'
|
|
||||||
# uci commit wireless
|
|
||||||
#
|
|
||||||
# uci set dhcp.lan.ignore='1'
|
|
||||||
# uci commit dhcp
|
|
||||||
#
|
|
||||||
# uci set firewall.@zone[1].network='wan wan6 wwan'
|
|
||||||
# uci commit firewall
|
|
||||||
#
|
|
||||||
# /etc/init.d/relayd enable
|
|
||||||
# /etc/init.d/relayd start
|
|
||||||
# /etc/init.d/network restart
|
|
||||||
#
|
|
||||||
# /etc/init.d/firewall restart
|
|
||||||
# wifi
|
|
||||||
|
|
||||||
EOF
|
uci set network.wwan=interface
|
||||||
'';
|
uci set network.wwan.proto='dhcp'
|
||||||
|
uci commit network
|
||||||
|
|
||||||
|
uci set network.relay=interface
|
||||||
|
uci set network.relay.proto='relay'
|
||||||
|
uci set network.relay.network='lan wwan' # bridges LAN and upstream
|
||||||
|
uci commit network
|
||||||
|
|
||||||
|
# Edit the existing AP or add a new one:
|
||||||
|
uci set wireless.default_radio0.ssid='YourRepeaterSSID'
|
||||||
|
uci set wireless.default_radio0.encryption='psk2'
|
||||||
|
uci set wireless.default_radio0.key='YourRepeaterPassword'
|
||||||
|
uci commit wireless
|
||||||
|
|
||||||
|
uci set dhcp.lan.ignore='1'
|
||||||
|
uci commit dhcp
|
||||||
|
|
||||||
|
uci set firewall.@zone[1].network='wan wan6 wwan'
|
||||||
|
uci commit firewall
|
||||||
|
|
||||||
|
/etc/init.d/relayd enable
|
||||||
|
/etc/init.d/relayd start
|
||||||
|
/etc/init.d/network restart
|
||||||
|
|
||||||
|
/etc/init.d/firewall restart
|
||||||
|
wifi
|
||||||
|
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
inputs.openwrt-imagebuilder.lib.build config;
|
inputs.openwrt-imagebuilder.lib.build config;
|
||||||
|
|||||||
Reference in New Issue
Block a user