nit on bash script

consolidate-nix
pegasust 2022-12-03 10:17:50 +00:00
parent 57eb4a4066
commit eea969184a
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
## Configures a new nixos system to this repository
## Blame: Hung Tran (Pegasust) <pegasucksgg@gmail.com>
set -xv set -xv
HOSTNAME=${1} HOSTNAME=${1}
@ -17,7 +20,7 @@ SYSNIX_DIR="${SCRIPT_DIR}/../nix-conf/system"
# Copy hardware-configuration of existing machine onto our version control # Copy hardware-configuration of existing machine onto our version control
SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}" SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}"
HARDWARE_CONF="${SYSNIX_PROF}/hardware-configuration.nix" HARDWARE_CONF="${SYSNIX_PROF}/hardware-configuration.nix"
if [ ! -f "${HARDWARE_CONF}" ]; then; if [ ! -f "${HARDWARE_CONF}" ]; then
mkdir "$SYSNIX_PROF" mkdir "$SYSNIX_PROF"
sudo cp /etc/nixos/hardware-configuration.nix ${HARDWARE_CONF} sudo cp /etc/nixos/hardware-configuration.nix ${HARDWARE_CONF}
fi fi