#!/usr/bin/env bash
set -euxo pipefail

if [[ ! -f /mnt/nix/nixos-22.11 ]]; then
  rm -rf /mnt/nix/*
  cp -r /nix/* /mnt/nix/
  touch /mnt/nix/nixos-22.11
  echo "initialized cache"
else
  echo "cache already initialized"
fi