nas/README.md

72 lines
1.9 KiB
Markdown
Raw Normal View History

2024-04-18 20:39:32 +01:00
# NixOS configuration for NAS server "chopper"
This repository is for development of the NixOS configuration of my NAS server.
## Hardware
This is intended to run on a RockPro64 with two 40TB HDDs as storage and a 64GB
MicroSD card as boot and OS.
## Goals
### Zeroth milestone
2024-05-04 13:17:27 +01:00
- [X] SSH daemon
2024-05-04 13:38:17 +01:00
- [X] User who can act as a local admin
2024-04-18 20:39:32 +01:00
### First milestone
- [X] ZFS set up on the HDDs
- [X] Plex media server
2024-04-18 20:39:32 +01:00
### Second milestone
- [ ] Samba for easy file access from Windows
- [ ] NFS for easy file access from Linux
### Third milestone
- [ ] Torrent client web control interface available over LAN
- [ ] Torrent client downloads over VPN
## Building
To build the SD image:
```bash
2024-05-04 13:17:27 +01:00
# building the NixOS portions
2024-04-18 20:39:32 +01:00
nix build .#nixosConfigurations.chopper.config.system.build.sdImage
2024-05-04 13:17:27 +01:00
cp result/sd-image/*.zst . # note it will be write-protected
nix-shell -p zstd --run "unzstd *.zst"
sudo dd if=$(echo -n *img) of=/dev/sda status=progress bs=4096
# build uboot
nix-build '<nixpkgs>' --argstr system aarch64-linux -A ubootRockPro64 --out-link ubootRockPro64
sudo dd if=ubootRockPro64/idbloader.img of=/dev/sda conv=fsync,notrunc bs=512 seek=64
sudo dd if=ubootRockPro64/u-boot.itb of=/dev/sda conv=fsync,notrunc bs=512 seek=16384
2024-04-18 20:39:32 +01:00
```
Further instructions can be found on these pages:
[NixOS Wiki/NixOS on ARM/PINE64 RockPro64](https://wiki.nixos.org/wiki/NixOS_on_ARM/PINE64_ROCKPro64)
[NixOS Wiki/NixOS on ARM/Installation](https://wiki.nixos.org/wiki/NixOS_on_ARM/Installation)
2024-05-04 08:49:43 +01:00
[Pine64/RockPro64/Installing Arch Linux ARM](https://pine64.org/documentation/ROCKPro64/Software/Installing_Arch_Linux_ARM/)
2024-04-18 20:39:32 +01:00
2024-05-04 13:40:19 +01:00
## Updating
From `chopper`:
```bash
sudo nixos-rebuild switch --flake .
```
2024-04-18 20:39:32 +01:00
## Notes
### Building boot thing
```bash
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./sd-image.nix --argstr system aarch64-linux
cp result/sd-image/*.zst .
nix-shell -p zstd --run "unzstd *.zst"
sudo dd if=*.image of=/dev/sda status=progress bs=4096
```