diff --git a/scripts/Common/OS/install.fish b/scripts/Common/OS/install.fish index 98ed629d..d2066482 100755 --- a/scripts/Common/OS/install.fish +++ b/scripts/Common/OS/install.fish @@ -10,7 +10,9 @@ if [ (id -u) -eq 0 ] runHook createUser || \ begin - useradd \ + echo "Creating setup user"; + + and useradd \ --comment "PortValhalla Setup User" \ --system \ --no-user-group \ @@ -44,7 +46,9 @@ else end and runHook installSoftware || begin - if [ -n "$deployScript" ] + echo "Installing software..." + + and if [ -n "$deployScript" ] source $deployScript end end @@ -52,8 +56,10 @@ else runHook initializeUsers || begin if [ -n "$deployScript" ] source "$dir/../Scripts/config.fish" + for name in (getUsers | jq '.[]' --raw-output0 | string split0) - source $deployScript userConfig $name + echo "Configuring user `$name`..." + and source $deployScript userConfig $name end end end @@ -62,6 +68,7 @@ else and sudo git config remove-section --system safe and begin + echo "Cleaning installation scripts..." set -l projectPath (realpath "$(status dirname)/../../..") cd (dirname "$projectPath") sudo rm -rf "$projectPath" diff --git a/scripts/Common/OS/setup.fish b/scripts/Common/OS/setup.fish index 14b5d914..34d9a234 100755 --- a/scripts/Common/OS/setup.fish +++ b/scripts/Common/OS/setup.fish @@ -43,21 +43,29 @@ function runSetup "$argv" end - getOSConfig partition.script > "$script" + echo "Partitioning drives..." + and getOSConfig partition.script > "$script" and "$script" and rm "$script" # Copy `nixpkgs` channel + and echo "Preparing nix..." + and begin set -l channelDir /nix/var/nix/profiles/per-user/root/channels/nixpkgs mkdir -p (dirname "$mountDir/$channelDir") cp -r "$channelDir" "$mountDir/$channelDir" end + and echo "Installing dependencies..." and runHook installValhallaDeps + + and echo "Cloning project..." and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" runChroot "$mountDir" git config --system --add safe.directory "$PROJECT_CLONE_ROOT" and runHook setupOS || true + + and echo "Preparing auto-login..." and runHook autologin || true and begin diff --git a/scripts/Common/OS/users.fish b/scripts/Common/OS/users.fish index 493af494..bc9a7e51 100755 --- a/scripts/Common/OS/users.fish +++ b/scripts/Common/OS/users.fish @@ -3,8 +3,11 @@ set -l dir (status dirname) source "$dir/../Scripts/config.fish" set -l users (getUsers) +echo "Creating users..." for name in (echo "$users" | jq '.[]' --raw-output0 | string split0) + echo "Creating user `$name`..." + function getUserInfo -V name -a config getUserConfig "$name" "$config" $argv[2..] end