chore: Finish up install scripts.

This commit is contained in:
greysoh 2024-07-19 13:57:30 -04:00
parent 3c291b8a95
commit 72b9dd88e5
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
8 changed files with 72 additions and 14 deletions

View file

@ -1,6 +1,6 @@
let
pkgs = import <nixpkgs> {};
secret_data = builtins.readFile ./secrets.nix;
update_script = builtins.readFile ./update.sh;
in {
imports = [
./secrets.nix
@ -29,14 +29,10 @@ in {
chmod -R 644 /etc/rancher 2> /dev/null > /dev/null
chmod -R 644 /var/lib/rancher 2> /dev/null > /dev/null
if [ ! -d "/etc/nixos/git" ]; then
echo "Waiting for true internet bringup..."
sleep 10
echo "Downloading configuration files..."
${pkgs.git}/bin/git clone https://git.hofers.cloud/greysoh/kittehcluster /etc/nixos/
cp -r ${pkgs.writeText "secrets.nix" secret_data} /etc/nixos/nixinfra/secrets.nix
fi
# Because I'm lazy (and this works), we use this method to write the file
rm -rf /home/clusteradm/update
ln -s ${pkgs.writeShellScript "update" update_script} /home/clusteradm/update
echo "Done."
'';
};