feat(tyr): setup nfs share.

This commit is contained in:
CronyAkatsuki 2025-09-26 02:59:19 +02:00
parent 4a5788ef8a
commit 757336eb6a
3 changed files with 12 additions and 2 deletions

View file

@ -5,7 +5,7 @@
... ...
}: let }: let
auto_mount = pkgs.writeShellScriptBin "auto_mount" '' 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 if [ $? -ne 0 ]; then
systemctl stop mnt-share.automount systemctl stop mnt-share.automount
@ -24,7 +24,7 @@ in {
config = lib.mkIf config.crony.nfs-share.enable { config = lib.mkIf config.crony.nfs-share.enable {
# Nfs share # Nfs share
fileSystems."/mnt/share" = { fileSystems."/mnt/share" = {
device = "192.168.0.4:/mnt/nfs"; device = "192.168.0.5:/export/nfs";
fsType = "nfs"; fsType = "nfs";
options = ["_netdev" "noauto" "x-systemd.automount" "x-systemd.mount-timeout=10" "timeo=14" "x-systemd.idle-timeout=600"]; options = ["_netdev" "noauto" "x-systemd.automount" "x-systemd.mount-timeout=10" "timeo=14" "x-systemd.idle-timeout=600"];
}; };

View file

@ -5,5 +5,6 @@
./wallos.nix ./wallos.nix
./wireguard.nix ./wireguard.nix
./secrets.nix ./secrets.nix
./nfs-server.nix
]; ];
} }

View 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];
}