fix: create directory and add to version control so nix flake sees

nix-components
pegasust 2022-11-29 19:58:57 -07:00
parent 9ec0aa5e84
commit 88cde1a5b5
1 changed files with 5 additions and 2 deletions

View File

@ -15,10 +15,13 @@ echo "SCRIPT_DIR: ${SCRIPT_DIR}"
SYSNIX_DIR="${SCRIPT_DIR}/../system-nix"
# Copy hardware-configuration of existing machine onto our version control
HARDWARE_CONF="${SYSNIX_DIR}/profiles/${HOSTNAME}/hardware-configuration.nix"
if [ ! -f ${HARDWARE_CONF} ];
SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}"
HARDWARE_CONF="${SYSNIX_PROF}/hardware-configuration.nix"
if [ ! -f "${HARDWARE_CONF}" ]; then;
mkdir "$SYSNIX_PROF"
sudo cp /etc/nixos/hardware-configuration.nix ${HARDWARE_CONF}
fi
git add "${HARDWARE_CONF}"
echo "Apply nixos-rebuild"
sudo nixos-rebuild switch --flake "${SYSNIX_DIR}#${HOSTNAME}"