PortValhalla/scripts/NixOS/OS/setup.sh

23 lines
648 B
Bash
Raw Normal View History

2023-11-28 00:45:12 +00:00
#!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null;
NIXOS_DISK="${NIXOS_DISK}";
NIXOS_HOSTNAME="${NIXOS_HOSTNAME}";
NIXOS_MOUNT_ROOT="${NIXOS_MOUNT_ROOT:-"/mnt"}";
NIXOS_CONFIG_REPOSITORY="${NIXOS_CONFIG_REPOSITORY:-"https://git.nuth.ch/manuth/NixOSConfig"}";
OS_LABEL="${OS_LABEL:-NixOS}";
OS_MOUNT_ROOT="${NIXOS_MOUNT_ROOT}" \
OS_DISK="${NIXOS_DISK}" \
OS_LABEL="${OS_LABEL}" \
BOOT_MOUNTPOINT="/boot/efi" \
2023-11-28 00:45:12 +00:00
. "../../Common/OS/partition.sh";
configRoot="$NIXOS_MOUNT_ROOT/etc/nixos";
mkdir -p "$configRoot";
git clone "$NIXOS_CONFIG_REPOSITORY" "$configRoot";
cd "$configRoot";
2023-12-02 00:26:41 +00:00
nixos-install --flake ".#$NIXOS_HOSTNAME";
2023-11-28 00:45:12 +00:00
popd > /dev/null;