mirror of
https://github.com/caperren/nixos-configs.git
synced 2025-11-08 11:41:14 +00:00
Added initial_setup.sh for setup bootstrapping
This commit is contained in:
@@ -38,3 +38,21 @@ if [[ "$SCRIPT_DIR" != "$NIXOS_REPO_CONFIG_PATH" ]]; then
|
||||
exec "$NIXOS_REPO_CONFIG_PATH/initial_setup.sh"
|
||||
exit
|
||||
fi
|
||||
|
||||
# If this is a new host, create the config path
|
||||
if [ ! -d "$HOST_CONFIG_PATH" ]; then
|
||||
mkdir -p "$HOST_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
# Copy initial config files from nixos setup, and symlink to our repo, if not set up yet
|
||||
if [ ! -L "/etc/nixos" ]; then
|
||||
# Copy the existing config files
|
||||
cp /etc/nixos/configuration.nix "$HOST_CONFIG_PATH/."
|
||||
cp /etc/nixos/hardware-configuration.nix "$HOST_CONFIG_PATH/."
|
||||
|
||||
# Backup the existing nixos config folder
|
||||
sudo mv /etc/nixos /etc/nixos_bkp
|
||||
|
||||
# Create symlink
|
||||
sudo ln -s "$NIXOS_REPO_CONFIG_PATH" /etc/nixos
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user