feat: add nfs

This commit is contained in:
Truxnell 2024-04-10 19:48:07 +10:00
parent 883df34aa8
commit 9fc6082c5b
3 changed files with 27 additions and 0 deletions

View file

@ -33,6 +33,8 @@
zfs.impermanenceRollback = true;
};
mySystem.services.nfs.enable = true;
boot = {
initrd.availableKernelModules = [ "xhci_pci" "ahci" "mpt3sas" "nvme" "usbhid" "usb_storage" "sd_mod" ];

View file

@ -6,5 +6,6 @@
./systempackages.nix
./nix.nix
./zfs.nix
./nfs
];
}

View file

@ -0,0 +1,24 @@
{ lib
, config
, ...
}:
let
cfg = config.mySystem.services.nfs;
in
{
options.mySystem.services.nfs = {
enable = lib.mkEnableOption "nfs";
exports = lib.mkOption {
type = lib.types.str;
default = "";
};
};
config = lib.mkIf cfg.enable {
services.nfs.server.enable = true;
services.nfs.server.exports = cfg.exports;
networking.firewall.allowedTCPPorts = [
2049
];
};
}