{"id":19557031,"url":"https://github.com/rubenhoenle/nixoserver","last_synced_at":"2025-04-26T22:33:18.850Z","repository":{"id":214499358,"uuid":"736642407","full_name":"rubenhoenle/NixOServer","owner":"rubenhoenle","description":"NixOS Server configuration","archived":false,"fork":false,"pushed_at":"2025-04-20T22:09:35.000Z","size":182,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-26T07:42:50.809Z","etag":null,"topics":["homelab","linux","nixos","server"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubenhoenle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-28T13:11:54.000Z","updated_at":"2025-04-20T22:09:39.000Z","dependencies_parsed_at":"2024-01-02T14:27:54.832Z","dependency_job_id":"3b774c90-22df-43a0-af65-e8242462e06e","html_url":"https://github.com/rubenhoenle/NixOServer","commit_stats":null,"previous_names":["rubenhoenle/nixoserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhoenle%2FNixOServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhoenle%2FNixOServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhoenle%2FNixOServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhoenle%2FNixOServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubenhoenle","download_url":"https://codeload.github.com/rubenhoenle/NixOServer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251063667,"owners_count":21530837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homelab","linux","nixos","server"],"created_at":"2024-11-11T04:40:00.889Z","updated_at":"2025-04-26T22:33:13.841Z","avatar_url":"https://github.com/rubenhoenle.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![run flake check](https://github.com/rubenhoenle/NixOServer/actions/workflows/build.yaml/badge.svg?branch=main\u0026event=push)](https://github.com/rubenhoenle/NixOServer/actions/workflows/build.yaml)\n[![update flake lock](https://github.com/rubenhoenle/NixOServer/actions/workflows/flake-update.yaml/badge.svg?branch=main)](https://github.com/rubenhoenle/NixOServer/actions/workflows/flake-update.yaml)\n\n# NixOS Server Configuration\n\n## Rebuilding\n\n`nixos-rebuild switch --build-host root@mandalore --target-host root@mandalore --flake \".#mandalore\"`\n\n`nixos-rebuild switch --target-host root@scarif --flake \".#scarif\"`\n\n## Startup\n\n`ssh root@\u003cIP\u003e -p 2222`\n\n_Don't forget to specify root as username when connecting to the initrd ssh session!_\n\n## Backups\n\n### Offsite backup\n\n```bash\n# start\nsystemctl start restic-backups-fullbackup\n\n# view status\nsystemctl status restic-backups-fullbackup\n\n# view snapshots\nrestic-fullbackup snapshots\n\n# browse snapshots\nrestic-fullbackup ls latest /var/lib/\n\n# restore\n/run/current-system/sw/bin/restic-fullbackup restore --target / latest\n```\n\n### Local harddrive backup\n\n```bash\n# IMPORTANT: the mount/unmount pkgs are only available for the root user\n\n# mount the HDD backup drive\nhdd-mount\n\n# starting the HDD backup\nsystemctl start restic-backups-hdd\n\n# showing the status of the HDD backup\nsystemctl status restic-backups-hdd\n\n# unmount the HDD backup drive\nhdd-unmount\n\n# showing the snapshots of the HDD backup\nrestic-hdd snapshots\n\n# restoring the backup from the HDD\nrestic-hdd restore latest --target /\n```\n\n## Podman containers\n\nTo view the logs of the podman containers specified in the nix config, use the following command:\n\n```bash\n# show containers\nsudo podman ps -a\n\n# show logs for container\nsudo podman logs -f \u003cCONTAINER_ID\u003e\n```\n\n## Services\n\n### Paperless service\n\n```bash\n# export\n/var/lib/paperless/data/paperless-manage document_exporter /home/ruben/paperless-export-001\n```\n\n### Git server\n\n```bash\n# create a repo on the server\nsudo -u git bash -c \"git init --bare ~/myproject.git\"\n\n# then you can use it via the following url\ngit@git.hoenle.xyz:myproject.git\n```\n\n## Troubleshooting\n\n- In case of systemd temp files and directories not created properly when testing backups, run `sudo systemd-tmpfiles --create` on the server.\n\n## SSH Tunnelling\n\n```bash\n# port forward localhost:3000 to mandalore:2020\nssh mandalore -L 3000:localhost:2020 -fN\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhoenle%2Fnixoserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubenhoenle%2Fnixoserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhoenle%2Fnixoserver/lists"}