Add jupiter base

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-23 23:50:06 +00:00
parent 709ed4b9ac
commit d90ad86c16
17 changed files with 383 additions and 9 deletions

View File

@@ -190,12 +190,19 @@ cat <<EOF > "./hosts/$host/README.md"
# $host
EOF
sed -i "/nixosConfigurations = {/a\\
$host = nixpkgs.lib.nixosSystem rec {\\
system = \"x86_64-linux\";\\
modules = [ ./hosts/$host ];\\
specialArgs = { inherit inputs system; };\\
};\n\n" flake.nix
sed -i "/knownHosts = {/a\\ $host.publicKeyFile = ../../../../$host/secrets/ssh_host_ed25519_key.pub;" ./hosts/common/configs/system/ssh/default.nix
new_entry="| \`$host\` | [hosts/$host/README.md](./hosts/$host/README.md) |"
last_table_line=$(grep -n "^| " README.md | tail -n 1 | cut -d: -f1)
sed -i "${last_table_line}a$new_entry" README.md
sed -i "/knownHosts = {/a\\ $host.publicKeyFile = ../../../../$host/secrets/ssh_host_ed25519_key.pub;" ./hosts/common/configs/system/ssh/default.nix
nix fmt
echo "Host $host has been successfully added."

View File

@@ -19,6 +19,7 @@ find . -type f -name "sops.yaml" | while IFS= read -r sops_file; do
done
sed -i "/$host/d" ./hosts/common/configs/system/ssh/default.nix
sed -i "/$host = nixpkgs.lib.nixosSystem rec {/,/^[[:space:]]*};/d" flake.nix
sed -i "/$host/d" ./README.md
rm -rf "./hosts/$host"