added script to upate /etc/nixos/flake.nix
This commit is contained in:
parent
ca256bb1c6
commit
2fcbd9c303
@ -4,17 +4,17 @@ cd /home/free/Downloads
|
||||
|
||||
|
||||
|
||||
#### TEST SCRIPT 1 ####
|
||||
#### SCRIPT 1 ####
|
||||
|
||||
/run/current-system/sw/bin/wget "https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/file_fixes_and_new_services/test.sh"
|
||||
/run/current-system/sw/bin/wget "https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/file_fixes_and_new_services/sovran-pro-flake-update.sh"
|
||||
|
||||
/run/current-system/sw/bin/bash /home/free/Downloads/test.sh
|
||||
/run/current-system/sw/bin/bash /home/free/Downloads/sovran-pro-flake-update.sh
|
||||
|
||||
rm -rf /home/free/Downloads/test.sh
|
||||
rm -rf /home/free/Downloads/sovran-pro-flake-update.sh
|
||||
|
||||
|
||||
|
||||
#### TEST SCRIPT 2 ####
|
||||
#### SCRIPT 2 ####
|
||||
|
||||
|
||||
|
||||
|
96
file_fixes_and_new_services/sovran-pro-flake-update.sh
Normal file
96
file_fixes_and_new_services/sovran-pro-flake-update.sh
Normal file
@ -0,0 +1,96 @@
|
||||
#!/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/sovran-pro-flake-update/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/sovran-pro-flake-update ; touch /var/lib/beacons/file_fixes_and_new_services/sovran-pro-flake-update/started
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
/run/current-system/sw/bin/echo "Could Not Create Initial Tag"
|
||||
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#### MAIN SCRIPT ####
|
||||
|
||||
/run/current-system/sw/bin/rm /etc/nixos/flake.nix
|
||||
|
||||
/run/current-system/sw/bin/cat > /etc/nixos/flake.nix <<- "EOF"
|
||||
|
||||
{
|
||||
description = "Sovran_SystemsOS for the Sovran Pro from Sovran Systems";
|
||||
|
||||
inputs = {
|
||||
|
||||
Sovran_Systems.url = "git+https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS";
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, Sovran_Systems, ... }@inputs: {
|
||||
|
||||
nixosConfigurations."nixos" = Sovran_Systems.inputs.nixpkgs.lib.nixosSystem {
|
||||
|
||||
system = "x86_64-linux";
|
||||
|
||||
modules = [
|
||||
|
||||
./hardware-configuration.nix
|
||||
|
||||
Sovran_Systems.nixosModules.Sovran_SystemsOS
|
||||
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
/run/current-system/sw/bin/echo "Could Not Run sovran-pro-flake-update"
|
||||
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#### CREATE COMPELETE TAG ####
|
||||
|
||||
/run/current-system/sw/bin/touch /var/lib/beacons/file_fixes_and_new_services/sovran-pro-flake-update/completed
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
/run/current-system/sw/bin/echo "Could Not Create Completed Tag"
|
||||
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user