diff options
author | Soispha <soispha@vhack.eu> | 2023-07-02 11:05:05 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-07-10 16:44:17 +0200 |
commit | 9a76c7c7db5a1bf1952ff91dd757666903bf5236 (patch) | |
tree | b52e00fe75d8f7fc99509097795b307b0bfcc4f3 /bootstrap/02_setup | |
parent | Fix(system/disks): Make ESP bootable (diff) | |
download | nixos-config-9a76c7c7db5a1bf1952ff91dd757666903bf5236.tar.gz nixos-config-9a76c7c7db5a1bf1952ff91dd757666903bf5236.zip |
Fix(bootstrap): Finished scripts
Diffstat (limited to '')
-rwxr-xr-x | bootstrap/02_setup | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/bootstrap/02_setup b/bootstrap/02_setup index a9e534ab..68affe85 100755 --- a/bootstrap/02_setup +++ b/bootstrap/02_setup @@ -2,28 +2,10 @@ # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH -msg "Select a host-config:" -hosts=$(mktmp); -host=""; -curl https://codeberg.org/soispha/nixos-config/raw/branch/prime/flake/nixosConfigurations/default.nix 2> /dev/null | awk -F '"' '/hosts = /{for (i=2;i<NF;i+=2) {print $i}}' > "$hosts"; +. %SCRIPT_ENSURE_CONFIG_VARIABLES -while ! grep "$host" "$hosts" > /dev/null || [ "$(printf "%s" "$host" | wc -c)" -eq 0 ]; do - i=1; - while read -r ho ; do - printf "%4s) %s \n" "$i" "$ho"; - i=$((i+1)); - done < "$hosts" - printf "%4s) Exit\n" "q" - readp "Enter a option: " host - - [ "$host" = "q" ] && exit 1 - host=$(awk -v i="$host" '{if (NR==i) {print $0}}' "$hosts"); - if ! grep "$host" "$hosts" > /dev/null || [ "$(printf "%s" "$host" | wc -c)" -eq 0 ]; then - warning "No host selected. Select a host to continue.\n" - fi -done -nixos-install --flake git+https://codeberg.org/soispha/nixos-config#${host} --no-root-passwd +nixos-install --flake git+https://codeberg.org/soispha/nixos-config#"$NIX_HOST" --no-root-passwd # clone the git config git clone https://codeberg.org/soispha/nixos-config.git /mnt/srv/etc/nixos @@ -33,13 +15,10 @@ mkdir --parents /mnt/srv/home chown 1000:100 --recursive /mnt/srv/home chmod 700 /mnt/srv/home -readp "Do you want to continue with the user configuration setup?[N/y]: " result; -case "$result" in - [yY]) +case "$SETUP_TO_CONFIG_SETUP" in + "yes") nix run "git+https://codeberg.org/soispha/nixos-config#config_setup" --experimental-features 'nix-command flakes'; ;; *) - msg "Well, if you want to do everything yourself..." - exit 1 ;; esac |