Files
nix/modules/homelab/nfs.nix
2025-10-06 21:38:49 -05:00

26 lines
500 B
Nix
Executable File

{ pkgs, config, lib, ... }:
# define nfs exports
let
cfg = config.modules.homelab.nfs;
nfs_exports = ''
/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 cfg.enable {
# enable nfs with all exports
services.nfs = {
server = {
enable = true;
exports = nfs_exports;
};
};
};
}