install: add split system and user targets

This commit is contained in:
Ryan Hughes
2026-06-04 18:35:01 -04:00
parent b29747a54b
commit 53e2611507
24 changed files with 172 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Setup sudo-less access for the privileged first-run system one-shot. The
# install user's ~/.local/state/omarchy/first-run.mode marker is created by
# finalize.sh while running as that user.
install_user="${OMARCHY_INSTALL_USER:-${USER:-}}"
install_mode_is offline || exit 0
[[ -n $install_user ]] || exit 0
mkdir -p /etc/sudoers.d
cat > /etc/sudoers.d/first-run <<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
$install_user ALL=(ALL) NOPASSWD: /usr/bin/systemctl
$install_user ALL=(ALL) NOPASSWD: /usr/bin/ufw
$install_user ALL=(ALL) NOPASSWD: /usr/bin/ufw-docker
$install_user ALL=(ALL) NOPASSWD: /usr/bin/gtk-update-icon-cache
$install_user ALL=(ALL) NOPASSWD: SYMLINK_RESOLVED
$install_user ALL=(ALL) NOPASSWD: FIRST_RUN_CLEANUP
EOF
chmod 440 /etc/sudoers.d/first-run
+5
View File
@@ -0,0 +1,5 @@
# Remove legacy paths replaced by package-owned Omarchy defaults.
rm -f /etc/udev/rules.d/99-power-profile.rules
rm -f /etc/udev/rules.d/99-wifi-powersave.rules
rm -f /etc/systemd/system.conf.d/99-omarchy-nofile.conf
rm -f /etc/systemd/user.conf.d/99-omarchy-nofile.conf
+4
View File
@@ -0,0 +1,4 @@
# Update localdb so locate can find the installed system files immediately.
if omarchy-cmd-present updatedb; then
updatedb
fi
+8
View File
@@ -0,0 +1,8 @@
run_logged $OMARCHY_INSTALL/post-install/first-run-mode.sh
run_logged $OMARCHY_INSTALL/post-install/pacman.sh
run_logged $OMARCHY_INSTALL/post-install/legacy-cleanup.sh
run_logged $OMARCHY_INSTALL/post-install/udev.sh
run_logged $OMARCHY_INSTALL/post-install/localdb.sh
if install_mode_is online; then
run_logged $OMARCHY_INSTALL/post-install/allow-reboot.sh
fi
+3
View File
@@ -0,0 +1,3 @@
# Apply package-owned udev rules for the live install session when possible.
udevadm control --reload 2>/dev/null || true
udevadm trigger --subsystem-match=power_supply 2>/dev/null || true