forked from tiiuae/ghaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Valentin Kharin <[email protected]>
- Loading branch information
1 parent
0911ef7
commit 4e9b79a
Showing
10 changed files
with
163 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
pkgs, | ||
toplevelDrv, | ||
disko, | ||
diskoConfig, | ||
}: | ||
pkgs.substituteAll { | ||
dir = "bin"; | ||
isExecutable = true; | ||
|
||
buildInputs = with pkgs; [nix nixos-install-tools disko]; | ||
|
||
pname = "ghaf-installer"; | ||
src = ./installer.sh; | ||
inherit (pkgs) runtimeShell; | ||
inherit toplevelDrv diskoConfig; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#! @runtimeShell@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
clear | ||
cat <<"EOF" | ||
,----.. ,---, | ||
/ / \ ,--.' | .--., | ||
| : : | | : ,--.' \ | ||
. | ;. / : : : | | /\/ | ||
. ; /--` : | |,--. ,--.--. : : : | ||
; | ; __ | : ' | / \ : | |-, | ||
| : |.' .'| | /' :.--. .-. || : :/| | ||
. | '_.' :' : | | | \__\/: . .| | .' | ||
' ; : \ || | ' | : ," .--.; |' : ' | ||
' | '/ .'| : :_:,'/ / ,. || | | | ||
| : / | | ,' ; : .' \ : \ | ||
\ \ .' `--'' | , .-./ |,' | ||
`---` `--`---' `--' | ||
EOF | ||
|
||
echo "Welcome to Ghaf installer!" | ||
|
||
echo "To install image choose path to the device on which image will be installed." | ||
|
||
lsblk | ||
read -p "Device name [e.g. sda]: " DEVICE_NAME | ||
|
||
export DISKO_CONFIG_FILE_WITH_DRIVE="$HOME/disk-config.nix" | ||
|
||
sed "s/DRIVE_PATH/\/dev\/$DEVICE_NAME/g" '@diskoConfig@' > $DISKO_CONFIG_FILE_WITH_DRIVE | ||
cat $DISKO_CONFIG_FILE_WITH_DRIVE | ||
echo $DISKO_CONFIG_FILE_WITH_DRIVE | ||
|
||
read -p 'WARNING: Next commmand will destory all previous data from your device, press Enter to proceed. ' | ||
echo "Partitioning..." | ||
disko --no-deps --debug --mode disko $DISKO_CONFIG_FILE_WITH_DRIVE | ||
|
||
read -p "Press Enter to install system" | ||
|
||
echo "Installing..." | ||
nixos-install --option binary-caches “” --no-root-passwd --system "@toplevelDrv@" | ||
|
||
read -p "Press Enter to reboot" | ||
|
||
echo "Rebooting..." | ||
sleep 1 | ||
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters