Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/f90e34be-674b-4047-8096-c0db7883de1a Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
86 lines
2.1 KiB
Bash
Executable File
86 lines
2.1 KiB
Bash
Executable File
#!/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 ####
|
|
|
|
touch /etc/nixos/custom.nix
|
|
|
|
/run/current-system/sw/bin/cat > /etc/nixos/custom.nix <<- "EOF"
|
|
{ config, lib, ... }:
|
|
|
|
{
|
|
###########################################################
|
|
# #
|
|
# Sovran_SystemsOS — custom.nix #
|
|
# #
|
|
# Services, features, and roles are managed by the #
|
|
# Sovran Hub. Any changes you make through the Hub #
|
|
# will appear in the "Hub Managed" section below. #
|
|
# #
|
|
# If you want to add your own NixOS modules or #
|
|
# configuration, place them here — outside of the #
|
|
# Hub Managed section. #
|
|
# #
|
|
###########################################################
|
|
|
|
# ─── Add your custom NixOS configuration below ───────────
|
|
|
|
}
|
|
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 |