feat(tyr): setup nfs share.
This commit is contained in:
parent
4a5788ef8a
commit
757336eb6a
3 changed files with 12 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
auto_mount = pkgs.writeShellScriptBin "auto_mount" ''
|
||||
timeout 1 ${pkgs.bash}/bin/bash -c ": < /dev/tcp/192.168.0.4/2049"
|
||||
timeout 1 ${pkgs.bash}/bin/bash -c ": < /dev/tcp/192.168.0.5/2049"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
systemctl stop mnt-share.automount
|
||||
|
@ -24,7 +24,7 @@ in {
|
|||
config = lib.mkIf config.crony.nfs-share.enable {
|
||||
# Nfs share
|
||||
fileSystems."/mnt/share" = {
|
||||
device = "192.168.0.4:/mnt/nfs";
|
||||
device = "192.168.0.5:/export/nfs";
|
||||
fsType = "nfs";
|
||||
options = ["_netdev" "noauto" "x-systemd.automount" "x-systemd.mount-timeout=10" "timeo=14" "x-systemd.idle-timeout=600"];
|
||||
};
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
./wallos.nix
|
||||
./wireguard.nix
|
||||
./secrets.nix
|
||||
./nfs-server.nix
|
||||
];
|
||||
}
|
||||
|
|
9
modules/servers/tyr/nfs-server.nix
Normal file
9
modules/servers/tyr/nfs-server.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
services.nfs.server = {
|
||||
enable = true;
|
||||
exports = ''
|
||||
/export/nfs 192.168.0.0/24(rw,sync,no_subtree_check) 172.16.0.0/24(rw,sync,no_subtree_check)
|
||||
'';
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [2049];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue