Setting up my NixOS home server.
This will be split into two parts. The first one is getting an SSH daemon running as quick as possible. The second part means setting up the complete system through SSH.
- Install NixOS on an SD card
a. Download the RaspberryPi image
b. Use
dd
to write it on the SD card - Boot up the RaspberryPi with a monitor and keyboard connected.
- curl and run the intialization file. For example
sh <(curl -s 192.168.0.10:5500/init-to-base/init.sh)
when running the VS-Code live reload server. - Set a password during the installation and use it to access the RaspberryPi for the second part.
On the RaspberryPi, you might want to run a server. The easiest way to do so is to dockerize everything and run docker.
- Run the
create-server.sh
script to set up the user and add the users SSH key. cd nextcloud-docker
- Run the necessary docker commands.
# create a volume for NextClouds App / Config
docker volume create --name nextcloud -o type=none -o device=/my/path/nextcloud -o o=bind
# create a volume for PostgreSQL databases
docker volume create --name db -o type=none -o device=/my/path/db -o o=bind
# Start PostgreSQL
POSTGRES_DB="" POSTGRES_USER="" POSTGRES_PASSWORD="" POSTGRES_HOST="" docker run -d --name db --hostname db -v db:/var/lib/postgresql/data postgres
# Start NextCloud with the volume mounted
docker run -d --name nextcloud --hostname nextcloud --link db -v nextcloud:/var/www/html nextcloud:fpm
# Build nginx
docker build -t nginx ./web
# Start nginx with NextCloud linked
docker run -d --name nginx --hostname nginx --link nextcloud -v nextcloud:/var/www/html nginx
### Setting up automatic backups
TBD