sudo pacman -S nfs-utils
aryan@archian:~$ cat /etc/exports
# /etc/exports - exports(5) - directories exported to NFS clients
#
# Example for NFSv3:
# /srv/home hostname1(rw,sync) hostname2(ro,sync)
# Example for NFSv4:
# /srv/nfs4 hostname1(rw,sync,fsid=0)
# /srv/nfs4/home hostname1(rw,sync,nohide)
# Using Kerberos and integrity checking:
# /srv/nfs4 *(rw,sync,sec=krb5i,fsid=0)
# /srv/nfs4/home *(rw,sync,sec=krb5i,nohide)
#
# Use `exportfs -arv` to reload.
/srv/nfs 192.168.1.0/24(rw,fsid=root)
/srv/nfs/pkg 192.168.1.0/24(ro,sync)
/srv/nfs/info 192.168.1.0/24(ro,sync)
/srv/nfs/home 192.168.1.0/24(ro,sync)
#/srv/nfs/home 192.168.1.0/24(rw,sync)
sudo mkdir -p /srv/nfs/pkg
sudo mount --bind /var/cache/pacman/pkg/ /srv/nfs/
sudo systemctl restart nfsv4-server.service
- mount with
# sudo pacman -S nginx
Enter these lines:
/etc/nginx/nginx.conf:
[...]
location / {
autoindex on;
root /var/cache/pacman/pkg;
[...]
Check configuration & Start the service:
# nginx -t
# systemctl start nginx
- bonus point: restart nginx with:
nginx -s reload
add the line under each repository in pacman configuraiton: /etc/pacman.d/ OR /etc/pacman.conf
CacheServer = http://192.168.1.3
- also it's disk space efficient if you direct to the tmp directory on client so it doesnt store cached pkgs.
CacheDir = /tmp