aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-04-01 16:15:37 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2023-04-01 16:15:37 +0200
commit16384226a152083048d11f5cc3c026a65b349548 (patch)
tree254aa8743998bc98fc4261f259b5789d63f38777
parent245031870fe51f813078052760dcdc123f43c1a4 (diff)
use sudo to run command as normal user
-rwxr-xr-xnais7
1 files changed, 4 insertions, 3 deletions
diff --git a/nais b/nais
index ae2ab09..2e7f89c 100755
--- a/nais
+++ b/nais
@@ -97,7 +97,7 @@ install_arch() {
wayland wayland-protocols wlroots xorg-xwayland \
git base-devel make networkmanager btrfs-progs sudo \
grub efibootmgr bat man-db ttf-sourcecodepro-nerd \
- libx11 libxft libxrender freetype2 dunst fzf
+ libx11 libxft libxrender freetype2 dunst fzf zsh zsh-syntax-highlighting
genfstab -U /mnt >> /mnt/etc/fstab || exit
@@ -110,6 +110,7 @@ install_arch() {
sed -i 's/# \(%wheel ALL=(ALL:ALL) NOPASSWD: ALL\)/\1/g' /mnt/etc/sudoers
arch-chroot /mnt useradd -m -G wheel "$USERNAME" || exit
echo "$USERNAME:$PASSWORD" | arch-chroot /mnt chpasswd
+ arch-chroot /mnt chsh -s /bin/zsh "$USERNAME"
arch-chroot /mnt sh -c "mkdir /home/$USERNAME/system"
arch-chroot /mnt sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/elk && cd elk && ./install $KEYUUID"
@@ -137,8 +138,8 @@ install_arch() {
arch-chroot /mnt sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/suckless/wayland/dbar && cd dbar && make install"
arch-chroot /mnt sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/suckless/st && cd st && make install"
arch-chroot /mnt sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/suckless/status && cd status && make install"
- arch-chroot /mnt sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/dotfiles && cd dotfiles && ./dotter"
- arch-chroot /mnt sh -c "cd /home/$USERNAME/ && git clone https://aur.archlinux.org/yay && cd yay && makepkg -si --noconfirm && cd / && rm -rf /home/$USERNAME/yay"
+ arch-chroot /mnt sudo -u "$USERNAME" sh -c "cd /home/$USERNAME/system && git clone https://git.nathanreiner.xyz/dotfiles && cd dotfiles && ./dotter"
+ arch-chroot /mnt sudo -u "$USERNAME" sh -c "cd /home/$USERNAME/ && git clone https://aur.archlinux.org/yay && cd yay && makepkg -si --noconfirm && cd / && rm -rf /home/$USERNAME/yay"
arch-chroot /mnt chown -R "$USERNAME":"$USERNAME" "/home/$USERNAME/system"
echo Finished.