feat: add nfs
This commit is contained in:
parent
883df34aa8
commit
9fc6082c5b
3 changed files with 27 additions and 0 deletions
|
@ -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" ];
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
./systempackages.nix
|
||||
./nix.nix
|
||||
./zfs.nix
|
||||
./nfs
|
||||
];
|
||||
}
|
||||
|
|
24
nixos/modules/nixos/system/nfs/default.nix
Normal file
24
nixos/modules/nixos/system/nfs/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
Reference in a new issue