home-lab/modules/services/nfs.nix
Geir Okkenhaug Jerstad c392df4a93 Add ZFS support to sleeper-service
- Replace ext4 with ZFS pool 'filepool' for enhanced data integrity
- Add ZFS auto-scrub and TRIM services for file server
- Configure proper ZFS datasets: root, nix, var, storage
- Add networking hostId (a1b2c3d4) required for ZFS
- Update NFS and Transmission to use ZFS mount points
- Change file ownership to 'sma' user for server configuration
- Add comprehensive ZFS setup documentation

Ready for deployment with proper file server storage backend.
2025-06-05 17:16:32 +02:00

31 lines
853 B
Nix

# NFS Server Configuration
# Network File System server for home lab storage
{ config, pkgs, ... }:
{
# NFS server configuration
services.nfs.server = {
enable = true;
# Export the storage directory (ZFS dataset)
exports = ''
/mnt/storage 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash)
'';
# Create exports on startup
createMountPoints = true;
};
# Ensure the storage subdirectories exist (ZFS dataset is mounted at /mnt/storage)
systemd.tmpfiles.rules = [
"d /mnt/storage/media 0755 sma users -"
"d /mnt/storage/downloads 0755 sma users -"
"d /mnt/storage/backups 0755 sma users -"
"d /mnt/storage/shares 0755 sma users -"
];
# Required packages for NFS
environment.systemPackages = with pkgs; [
nfs-utils
];
# Firewall rules are already configured in network module
}