nix-config/sh/install/025-user
Donovan Glover 4e81aab657
Move installation steps to install directory
This helps separate the installation process from the other scripts that
are usually ran after a reboot, although this may change in the future
if chroot is preferred over executing the commands later.
2018-09-06 15:18:39 -04:00

24 lines
673 B
Bash

#!/bin/sh
#
# Create a new user account with sudo privileges and the fish shell.
# Then, and add a password to it.
#
# Note that the default password will be the same as your username.
#
# To change the root password, use passwd.
# To change the new user's password, use passwd <username>.
#
# https://wiki.archlinux.org/index.php/Password
set -xe
$USERNAME = "hello"
arch-chroot /mnt useradd -m -g users -G wheel -s /usr/bin/fish $USERNAME
# This is a workaround to the problem of using pipes with arch-chroot
echo "echo $USERNAME:$USERNAME | chpasswd" > /mnt/root/chpasswd.sh
chmod +x /mnt/root/chpasswd.sh
arch-chroot /mnt /root/chpasswd.sh
rm /mnt/root/chpasswd.sh