25 lines
485 B
Nix
25 lines
485 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
# define nfs exports
|
|
let
|
|
nfsExports = ''
|
|
/holocron/vault *(rw,sync,no_subtree_check,no_root_squash)
|
|
/holocron/media *(ro,sync,no_subtree_check)
|
|
'';
|
|
in
|
|
{
|
|
options = {
|
|
modules.homelab.nfs.enable = lib.mkEnableOption "enables nfs";
|
|
};
|
|
|
|
config = lib.mkIf config.modules.homelab.nfs.enable {
|
|
# enable nfs with all exports
|
|
services.nfs = {
|
|
server = {
|
|
enable = true;
|
|
exports = nfsExports;
|
|
};
|
|
};
|
|
};
|
|
}
|