Skip to content

Commit

Permalink
Add NFS option and enable it for kyuubi
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Oct 14, 2024
1 parent 3bba2a1 commit af3f8c7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions hosts/kyuubi/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ in {
# Define your hostname.
networking.hostName = lib.mkForce "kyuubi";

nfs.enable = true;

# environment.sessionVariables.FLAKE = "/home/${username}/Development/nix";

# Disable Autosuspend for USB Bluetooth dongles
Expand Down
6 changes: 3 additions & 3 deletions modules/nixos/services/nas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
}: {
imports = [
./drives.nix
./nfs.nix
];

options = {
nas.enable = lib.mkEnableOption "NAS utilities and config";
};
options.nas.enable = lib.mkEnableOption "NAS utilities and config";

config = lib.mkIf config.nas.enable {
drives.enable = lib.mkDefault true;
nfs.enable = lib.mkDefault false;
};
}
24 changes: 24 additions & 0 deletions modules/nixos/services/nas/nfs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
config,
lib,
...
}: {
options.nfs.enable = lib.mkEnableOption "NFS Settings for Server and Client";

config = lib.mkIf config.nfs.enable {
services.nfs.server = {
enable = true;
# fixed rpc.statd port; for firewall
lockdPort = 4001;
mountdPort = 4002;
statdPort = 4000;
extraNfsdConfig = '''';
};

networking.firewall = {
# for NFSv3; view with `rpcinfo -p`
allowedTCPPorts = [111 2049 4000 4001 4002 20048];
allowedUDPPorts = [111 2049 4000 4001 4002 20048];
};
};
}

0 comments on commit af3f8c7

Please sign in to comment.