From 58023e1ff8c4f4620ea1b5017e7d90bd9a351a39 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Sat, 12 Oct 2024 13:37:15 +0000 Subject: [PATCH] Add clawsiecats on Vultr instructions --- README.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 35f5711..f6b1cc7 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ # dotfiles -**(README out of date currently)** +[![machines](https://img.shields.io/github/actions/workflow/status/ritiek/dotfiles/generators.yml?label=machines)](https://github.com/ritiek/dotfiles/actions/workflows/machines.yml) +[![generators](https://img.shields.io/github/actions/workflow/status/ritiek/dotfiles/generators.yml?label=generators)](https://github.com/ritiek/dotfiles/actions/workflows/generators.yml) My dotfiles. For NixOS. As well as for Debian/Arch based distros maintained using -[chezmoi](https://www.chezmoi.io/). +[chezmoi](https://www.chezmoi.io/). I previously used to maintain them by writing +custom shell scripts (in the [legacy](https://github.com/ritiek/dotfiles/tree/legacy) branch). -I previously maintained these manually in the [legacy](https://github.com/ritiek/dotfiles/tree/legacy) branch. + -## Installation +## Machines -### NixOS +My lovely machine configurations. + +### Mishy ```sh $ sudo mv /etc/nixos{,.bak} @@ -17,20 +21,85 @@ $ sudo git clone https://github.com/ritiek/dotfiles /etc/nixos ``` - Update machine specific values in `environment.nix`. -- Setup Intel/AMD/Nvidia graphics in `graphics.nix`. If you want to use Intel graphics, then comment out - `graphics.nix` entirely. If you want to be using Nvidia graphics, then leave `graphics.nix` unmodified. +- Setup Intel/AMD/Nvidia graphics in `graphics.nix`. If I want to use Intel graphics, then comment out + `graphics.nix` entirely. If I want to be using Nvidia graphics, then leave `graphics.nix` unmodified. - Rebuild config: ```sh # Create a machine specific `hardware-configuration.nix`. $ sudo nixos-generate-config -$ cd /etc/nixos +$ cd /etc/nixos/ $ nix flake update -$ sudo nixos-rebuild boot --flake '.#mishy' --upgrade-all --option eval-cache false +$ sudo nixos-rebuild boot --flake '.#mishy' $ sudo shutdown -r now ``` +### Clawsiecats +A configuration optimized for limited compute availability, supposed to be deployed on VPS machines. +It hosts routing services, VPN, some other useful stuff. + +Uncomment the disko partioning configuration that should be used in [flake.nix](/flake.nix) under the +variant before deployment. Supports MBR, GPT, GPT+LUKS. I haven't gotten MBR+LUKS working yet. + + +#### Vultr (GPT, GPT+LUKS) + +Looks to work fine on the most minimal [Vultr](https://www.vultr.com/) configuration. + +| CPU | Memory | Disk Space | +|-------|----------|------------| +| 1 vCPU | 0.5 GB | 10 GB SSD | + +**Deployment Steps** + +1. Replace your SSH public keys in [minimal-iso.nix](/generators/minimal-iso.nix). + +2. Build the minimal ISO: + ```bash + $ nix build '.#minimal-iso' + $ ls ./result/iso/nixos.iso + ``` + +3. Deploy a new machine on Vultr (any OS). + +4. Update the machine settings on Vultr to boot from the generated ISO. + Vultr takes in the ISO URL, so I'll need to host this ISO somewhere first. + +5. Replace the SSH public keys in asdfasdf (todo: i need to add n reuse ssh keys from flake.nix maybe). + +6. Deploy the configuration using nixos-anywhere: + ```bash + # For GPT+LUKS + $ ./machines/clawsiecats/anywhere.sh '.#clawsiecats-luks' root@vps.machine.ip.address --luks + + # For GPT + $ ./machines/clawsiecats/anywhere.sh '.#clawsiecats' root@vps.machine.ip.address + ``` +The installation succeeds hopefully. + +7. Remove the ISO from Vultr machine settings and let the machine reboot. + +8. (GPT+LUKS only) Decrypt the drive in dropbear: + ``` + $ ssh vps.machine.ip.address -p 2222 + ``` + +9. Log in to the freshy installed NixOS: + ``` + $ ssh vps.machine.ip.address + ``` + +#### HostVDS (MBR) +```bash +$ ./machines/clawsiecats/anywhere.sh '.#clawsiecats' root@vps.machine.ip.address +``` + +#### Minimal configuration (for testing purpose): +```bash +$ ./machines/clawsiecats/anywhere.sh '.#clawsiecats-minimal' root@vps.machine.ip.address +``` + ### Debian/Arch based distros Install [chezmoi](https://www.chezmoi.io/install/) and run: @@ -39,12 +108,6 @@ $ chezmoi init ritiek $ chezmoi apply -R ``` -#### clawsiecats - -```bash -$ ./machines/clawsiecats/anywhere.sh .#clawsiecats-luks root@vps.machine.ip.address --luks -``` - ## Screenshots March, 2020