<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN">nixos-cluster-config</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3zSEpEV9fuiUTTN5Qni4UWGhGLyN&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">nixos-cluster-config</div>
    <div class="repo-item">NixOS based Homelab</div>
    <div>rad:z3zSEpEV9fuiUTTN5Qni4UWGhGLyN</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6Mkm2rZRiLM8Xvb48Fsnrs5iLZ7eu8Rr8wuooyTW4re3o1c</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">main &#8594 f52275b6130c9450e0bcedd663b8bfd4248b4d7c</span> (Mon Mar  9 17:33:55 2026)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;"># nixos-cluster-config
Cluster of nixos nodes

On the host:

`touch /etc/nixos/ncluster.nix; chown philipcristiano /etc/nixos/ncluster.nix`

Then

`scp ncluster.nix $USER@TARGET_HOST:/etc/nixos/ncluster.nix`

Add `./ncluster.nix` to the imports

## Cluster bootstrapping

### Vault

See [vault/README.md](vault/README.md)

## Consul Value

Expected consul values

`site/domain` - Base domain expected for services.

## Networking

### VLANs

VLANs are used to provide separate interfaces for applications.
This is meant to work around limitations in macvlan interfaces in linux where the host cannot reach the macvlan&#x27;d interfaces.

In your nixos/configuration

```
  networking.vlans = {
	vlan110 = { id=110; interface=&quot;enp2s0&quot;; };
  };
  networking.interfaces.vlan110.useDHCP = true;
```

### BGP

BGP is used with GoCast to advertise floating IPs


## Site configuration

### `nomad_job.vars`

`domain` Internal domain for services
`docker_registry` Custom registry to use, should be equal to `docker-registry.$DOMAIN` if you are using this docker registry

## Services

(WIP)
```
bash deploy.sh
```


### Storage

Minio for S3-compatible storage that can be hosted on each node.

NFS (hosted outside this cluster) is used for services that cannot use S3

### Database


Postgres deployed for each service.


### Reverse-Proxy

Traefik and Let&#x27;s Encrypt for certs



### mktxp / mikrotik monitoring

####

Consul values:

* `credentials/mktxp/influxdb_organization`
* `credentials/mktxp/influxdb_token`
* `credentials/mktxp/password`
* `credentials/mktxp/username`

### Minio / S3-compatible blog storage

Consul values:

* `credentials/minio/root_user`
* `credentials/minio/root_pass`

### Baserow

#### Setup

Consul Values

* `credentials/baserow-postgres/USER` - Username for the root user
* `credentials/baserow-postgres/PASSWORD` - Root password
* `credentials/baserow-postgres/DB` - default DB
* `credentials/baserow-redis/password` - Username for the root user

## Bitcoin (and electrs, bitcoin-rpc-explorer, mempool)

NOT SAFE FOR USAGE AS A WALLET - only using this for an API to bitcoin data

Mempool also requires MariaDB



Consul Values

* `credentials/electrs/bitcoind_username` - Username from above
* `credentials/electrs/bitcoind_password` - Password generated by rpcauth

* `credentials/bitcoin-rpc-explorer/bitcoind_username` - Username from above
* `credentials/bitcoin-rpc-explorer/bitcoind_password` - Password generated by rpcauth

* `credentials/mempool/bitcoind_username` - Username from above
* `credentials/mempool/bitcoind_password` - Password generated by rpcauth

For each service:
* `credentials/bitcoind/rpcauth/USERNAME` - RPC auth line after `rpcauth=USERNAME:` Just the salt/password portion!


## Folio

### Postgres

Consul Values

* `credentials/folio-postgres/USER` - Username for the root user
* `credentials/folio-postgres/PASSWORD` - Root password
* `credentials/folio-postgres/DB` - default DB


### Frigate

#### Setup


Consul Values

* `credentials/frigate/mqtt_host` - MQTT Host IP
* `credentials/frigate/mqtt_username` - MQTT Username
* `credentials/frigate/mqtt_password` - MQTT Password
* `credentials/frigate/cameras/*` - Key: Camera name, Value: input.path for Frigate

### Matrix

#### Matrix-Hookshot

* `credentials/matrix-hookshot/passkey.pem` - passkey.pem from `openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096`

# Nomad Admin

### Set spread scheduling algorithm

```
curl -s $NOMAD_ADDR/v1/operator/scheduler/configuration |
    jq &#x27;.SchedulerConfig | .SchedulerAlgorithm=&quot;spread&quot;&#x27; |
  curl -X PUT $NOMAD_ADDR/v1/operator/scheduler/configuration -d @-
```

### Allow memory oversubscription

```
curl -s $NOMAD_ADDR/v1/operator/scheduler/configuration | \
  jq &#x27;.SchedulerConfig | .MemoryOversubscriptionEnabled=true&#x27; | \
  curl -X PUT $NOMAD_ADDR/v1/operator/scheduler/configuration -d @-
```
</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

