Skip to content

Commit

Permalink
Add clawsiecats on Vultr instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ritiek authored Oct 12, 2024
1 parent 29c2f3a commit 58023e1
Showing 1 changed file with 78 additions and 15 deletions.
93 changes: 78 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,105 @@
# 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.
<img src="https://i.imgur.com/kswC7UA.png" width="300">

## Installation
## Machines

### NixOS
My lovely machine configurations.

### Mishy

```sh
$ sudo mv /etc/nixos{,.bak}
$ 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:
Expand All @@ -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
Expand Down

0 comments on commit 58023e1

Please sign in to comment.