Use systemd-resolved's stub resolver

On first run, symlink systemd-resolved's resolver into /etc/resolv.conf

Matches migration 1754984623
This commit is contained in:
Samuel Péchèr
2025-09-26 18:47:07 +01:00
parent 1e859d37cb
commit c36839043d
3 changed files with 7 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ if [[ -f "$FIRST_RUN_MODE" ]]; then
bash "$OMARCHY_PATH/install/first-run/battery-monitor.sh"
bash "$OMARCHY_PATH/install/first-run/firewall.sh"
bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh"
bash "$OMARCHY_PATH/install/first-run/gnome-theme.sh"
sudo rm -f /etc/sudoers.d/first-run

View File

@@ -0,0 +1,4 @@
# https://wiki.archlinux.org/title/Systemd-resolved
echo "Symlink resolved stub-resolv to /etc/resolv.conf"
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

View File

@@ -5,9 +5,11 @@ touch ~/.local/state/omarchy/first-run.mode
# Setup sudo-less access for first-run
sudo tee /etc/sudoers.d/first-run >/dev/null <<EOF
Cmnd_Alias FIRST_RUN_CLEANUP = /bin/rm -f /etc/sudoers.d/first-run
Cmnd_Alias SYMLINK_RESOLVED = /usr/bin/ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
$USER ALL=(ALL) NOPASSWD: /usr/bin/ufw
$USER ALL=(ALL) NOPASSWD: /usr/bin/ufw-docker
$USER ALL=(ALL) NOPASSWD: /usr/bin/gtk-update-icon-cache
$USER ALL=(ALL) NOPASSWD: SYMLINK_RESOLVED
$USER ALL=(ALL) NOPASSWD: FIRST_RUN_CLEANUP
EOF
sudo chmod 440 /etc/sudoers.d/first-run