This commit is contained in:
2025-03-11 09:10:57 -04:00
parent 6f049807e6
commit 29070dd277
11 changed files with 14 additions and 1195 deletions

View File

@@ -4,24 +4,25 @@ This repository contains the configuration for multiple machines, as well as my
## Home Manager
Utilizing [Home Manager](https://nix-community.github.io/home-manager/)
Utilizing [Home Manager](https://nix-community.github.io/home-manager/). Check out the [README.md](./home-manager/README.md).
## NixOS
### Image Build
### NixOS Generators
```bash
# Remote Build
nix build .#packages.x86_64-linux.rke2-image -j0
nix build .#packages.x86_64-linux.rke2-image
```
### Copy Config
### NixOS Hosts
#### Copy Config
```bash
scp -r * root@10.10.10.10:/etc/nixos
rsync -av --exclude='.git' . root@HOST:/etc/nixos
```
### Partition Drives
#### Partition Drives
```bash
# Validate Disk
@@ -33,69 +34,27 @@ sudo nix \
--experimental-features "nix-command flakes" \
run github:nix-community/disko -- \
--mode disko \
--flake /etc/nixos#lin-va-rke1
--flake /etc/nixos#HOST_CONFIG
```
### Install NixOS
#### Install NixOS
```bash
# Install
sudo nixos-install --flake /etc/nixos#lin-va-rke1
sudo nixos-install --flake /etc/nixos#HOST_CONFIG
# Reboot
sudo reboot
```
### Copy Config Back to Host
#### Copy Config Back to Host
```bash
scp -r * nixos@10.0.20.201:/etc/nixos
rsync -av --exclude='.git' . root@HOST:/etc/nixos
```
### Rebuild NixOS
#### Rebuild NixOS
```bash
sudo nixos-rebuild switch
```
# Install Kubernetes (RKE2)
```
# Deploy First Node
sudo nixos-install --flake /etc/nixos#lin-va-rke1
# Reboot & Get Token
cat /var/lib/rancher/rke2/server/node-token
# Deploy Following Nodes
echo "<TOKEN>" > ./_scratch/rke2-token
sudo nixos-install --flake /etc/nixos#lin-va-rke2
```
### Notes
### Kasten Port Forward
```bash
# http://localhost:8000/k10/#/dashboard
kubectl port-forward -n kasten svc/gateway 8000:80
```
### Cloud Init
```
#cloud-config
hostname: rke-test
```
```
network:
version: 1
config:
- type: physical
name: enX0
subnets:
- type: static
address: 10.0.50.5/24
gateway: 10.0.50.254
```