host/home: add nfs server to share some dirs
This commit is contained in:
parent
21ce9728f3
commit
fa6cf08b3a
2 changed files with 33 additions and 2 deletions
hosts/home/hardware-configuration
|
@ -1,8 +1,10 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
# Include the results of the hardware scan.
|
||||
imports = [ ./generated.nix ];
|
||||
imports = [
|
||||
./generated.nix # Include the results of the hardware scan.
|
||||
./nfs.nix
|
||||
];
|
||||
|
||||
# Add support of usb
|
||||
boot.initrd.availableKernelModules = [ "usb_storage" ];
|
||||
|
|
29
hosts/home/hardware-configuration/nfs.nix
Normal file
29
hosts/home/hardware-configuration/nfs.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
fileSystems."/export/mynix" = {
|
||||
device = "/home/jan/mynix";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/export/projects" = {
|
||||
device = "/home/jan/projects";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
services.nfs.server = {
|
||||
enable = true;
|
||||
lockdPort = 4001;
|
||||
mountdPort = 4002;
|
||||
statdPort = 4000;
|
||||
exports = ''
|
||||
/export 192.168.0.0/24(rw,fsid=0,no_subtree_check)
|
||||
/export/mynix 192.168.0.0/24(rw,nohide,insecure,no_subtree_check)
|
||||
/export/projects 192.168.0.0/24(rw,nohide,insecure,no_subtree_check)
|
||||
'';
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 111 2049 4000 4001 4002 20048 ];
|
||||
allowedUDPPorts = [ 111 2049 4000 4001 4002 20048 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue