Skip to content

rubenhoenle/NixOServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

run flake check update flake lock

NixOS Server Configuration

nixos-rebuild switch --build-host root@mandalore --target-host root@mandalore --flake ".#mandalore"

nixos-rebuild switch --target-host root@scarif --flake ".#scarif"

Rebuilding

sudo nixos-rebuild switch --flake .#<HOSTNAME>

Startup

ssh root@<IP> -p 2222

Don't forget to specify root as username when connecting to the initrd ssh session!

Podman containers

To view the logs of the podman containers specified in the nix config, use the following command:

# show containers
sudo podman ps -a

# show logs for container
sudo podman logs -f <CONTAINER_ID>

Services

Paperless service

# testing the backup
systemctl start restic-backups-paperless.service
systemctl stop paperless-consumer.service paperless-scheduler.service paperless-task-queue.service paperless-web.service redis-paperless.service
sudo rm -rf /var/lib/paperless
update-switch

Git server

# create a repo on the server
sudo -u git bash -c "git init --bare ~/myproject.git"

# then you can use it via the following url
git@git.hoenle.xyz:myproject.git

Fileserver

# running the backup job
systemctl start restic-backups-fileserver.service

# restoring from backup
sudo -u fileserver /run/current-system/sw/bin/restic-fileserver restore --target / latest

Troubleshooting

  • In case of systemd temp files and directories not created properly when testing backups, run sudo systemd-tmpfiles --create on the server.