#!/usr/bin/env bash mkdir -p /etc/nix generation="$(basename "$(readlink /etc/nix-current)" || echo 0)" ((generation++)) echo "[nix-openwrt] creating new generation in /etc/nix/$generation" mkdir -p "/etc/nix/$generation" rm "/etc/nix-current" ln -s "/etc/nix/$generation" "/etc/nix-current" ln -s "/etc/nix-current/etc/config/wireless" "/etc/config/wireless" reload_config # mkdir -p "/etc/nix-current/config" # rm /etc/config/wireless # ln -s /etc/nix-current/config/wireless /etc/config/wireless