Initial commit

This commit is contained in:
Nathan van Doorn 2024-04-18 21:39:32 +02:00
commit 2776098b8c
3 changed files with 117 additions and 0 deletions

54
README.md Normal file
View File

@ -0,0 +1,54 @@
# 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
- [ ] SSH daemon
- [ ] User who can act as a local admin
### First milestone
- [ ] ZFS set up on the HDDs
- [ ] Plex media server
### 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
nix build .#nixosConfigurations.chopper.config.system.build.sdImage
```
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)
## 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
```

23
flake.lock Normal file
View File

@ -0,0 +1,23 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-XD6GfVgSfWjqqWAuybkvaxS1/xrwTrh3V1dSkoYJW3Q=",
"path": "/nix/store/jjjyazlmzjls1kdpgn776iy9w345yq7l-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

40
flake.nix Normal file
View File

@ -0,0 +1,40 @@
{
outputs = { self, nixpkgs }: {
# miscellaneous stuff that's important
nixosModules.base = {lib, ...}: {
boot.swraid.enable = lib.mkForce false;
networking.hostName = "chopper";
networking.firewall.enable = true;
system.stateVersion = "24.05";
};
# Configuration of individual users
nixosModules.users = {...}: {
users.users.taneb = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIV9ymP4tpq11a8wfUvn8eEEwAPvZZSPZTbASLh7YxOw nvd1234@gmail.com"
];
hashedPassword = "$y$j9T$MWZj8eSLcR5nrSOCemh.U/$g9PN2cQ78F8aV2ZJP5YU7xYrEZasQ70VmO5DfQLhc90";
};
users.mutableUsers = false;
};
# Configuration of SSH server
nixosModules.ssh = {...}: {
services.openssh = {
enable = true;
openFirewall = true;
settings.PasswordAuthentication = false;
};
};
nixosConfigurations.chopper = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
(nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix")
self.nixosModules.base
self.nixosModules.users
self.nixosModules.ssh
];
};
};
}