2023-08-10 17:09:16 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function log_console () {
|
|
|
|
echo "`date` :: $1" >> /var/lib/beacons/awesome.log
|
|
|
|
echo $1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#### CHECK TO SEE IF IT HAS BEEN RUN BEFORE ####
|
|
|
|
|
|
|
|
FILE=/var/lib/beacons/file_fixes_and_new_services/add-custom-nix/completed
|
|
|
|
|
|
|
|
if [ -e $FILE ]; then
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/echo "File Found :), No Need to Run ... Exiting"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#### CREATE INITIAL TAG ####
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/mkdir -p /var/lib/beacons/file_fixes_and_new_services/add-custom-nix ; touch /var/lib/beacons/file_fixes_and_new_services/add-custom-nix/started
|
|
|
|
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/echo "Could Not Create Initial Tag"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#### MAIN SCRIPT ####
|
|
|
|
|
2023-08-10 18:39:07 -07:00
|
|
|
touch /etc/nixos/custom.nix
|
2023-08-10 17:14:39 -07:00
|
|
|
|
2023-08-10 17:09:16 -07:00
|
|
|
/run/current-system/sw/bin/cat > /etc/nixos/custom.nix <<- "EOF"
|
|
|
|
|
2023-08-10 18:50:04 -07:00
|
|
|
{config, pkgs, lib, ...}:
|
2023-08-10 18:46:02 -07:00
|
|
|
|
|
|
|
# Add custom NixOS modules here.
|
|
|
|
|
2023-08-10 17:09:16 -07:00
|
|
|
let
|
|
|
|
personalization = import ./personalization.nix;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/echo "Could Not Run add-custom-nix"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### CREATE COMPELETE TAG ####
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/touch /var/lib/beacons/file_fixes_and_new_services/add-custom-nix/completed
|
|
|
|
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
|
|
|
|
/run/current-system/sw/bin/echo "Could Not Create Completed Tag"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
exit 0
|